Simon Cowell was left reeling last night when the public voted out the act he had expected would win The X Factor.
Danyl Johnson, 27, the often controversial singer who had been accused over the weeks of being temperamental and a bully, was dumped in the phone vote just short of next week's final.
Olly Murs, Joe McElderry and Stacey Solomon will now compete to win the show in next week's final after making it through.
A crushed Danyl Johnson learned he has not made the X Factor final last night as mentor Simon looked on
The teacher was consoled by Cowell after Olly, Joe and Stacey made it through
Cowell, 50, said: 'There is nothing I would have changed, nothing more he could have done. It is just one of those things. He has gone out on a high. He is a graceful loser. I am genuinely, genuinely firstly upset and secondly I have to say it has been a pleasure working with you.'
Johnson said: 'Simon has been amazing and I have made some of my best friends for life here. I'm looking forward to seeing friends and family and just do a couple of gigs. I'm going to see what happens.'
Johnson had previously been accused of bullying Stacey Soloman and girl band Kandy Rain in the X Factor house - all of which damaged his popularity.
Judge Louis Walsh had allegedly reacted by calling him 'vile'.
The call centre worker broke down in tears after his name was read out
Stories about Johnson's sexuality also tended to draw the attention away from his singing talent.
Last night, the teacher from Kent was non-committal about going back to his career in the classroom.
After coming within a hair's breadth of the £1million contract, Danyl said after the result: 'I might have gone out in the semi-final, but I've gone out to some of the best people I've ever met.'
Danyl then performed one last time, reprising his Michael Jackson tribute song from last night, Man In The Mirror.
Next, Joe McElderry was told the goods news and hugged mentor Cheryl
Stacey Solomon was on tenterhooks as she waited to see if she would make the final and then hugged mentor Dannii when her named was read out
In no particular order, call centre worker Olly Murs was told first, and promptly broke down in tears as he hugged his mentor Simon.
Next to hear the good news was Joe, who shouted with delight as he was put through.
Finally Stacey learned she would join the other two boys - meaning that judges Cheryl Cole, Dannii Minogue and Simon will all be rooting for their respective acts next week.
Bookmaker Coral made Joe 1-3 favourite to win the series after tonight's result.
Following the result, Danyl performed his last song, Michael Jackson's Man In The Mirror while a downcast Simon watched from the judges' desk
The teacher said he had gone out to some of the best people he had ever met
At the start of the results show the four judges were a bag of nerves, as they kept their fingers crossed that their acts would make it through.
Simon admitted it was one of the closest semi-finals he had ever seen, saying: 'I can't call it this time.'
Cheryl said she was 'sick with nerves' and Dannii agreed: 'Everyone's nervous. We just can't hide it.'
Dermot O'Leary congratulates finalists Olly, Stacey and Joe
Cheryl wore a stunning black dress complete with flowing train while Dannii donned a short sparkly dress
The four semi-finalists opened the show with a rendition of Jackson's Wanna be Startin' Somethin', which segued into Rihanna's hit Don' Stop The Music.
There were also performances from Lady Gaga and Janet Jackson.
Judges Louis Walsh, Dannii, Cheryl and Simon at the start of the show
The four semi-finalists opened the show with a rendition of Jackson's Wanna be Startin' Somethin', which segued into Rihanna's hit Don' Stop The Music
A make-up free Dannii posted a picture of herself on Twitter yesterday, posing a with a friend