Boris Johnson will take on Jeremy Hunt in the battle for Number 10 after a day of drama at Westminster.
Michael Gove was eliminated from the race by just two votes as Conservative MPs balked at the possibility of a bitter contest due to the "personal psychodrama" involving the Environment Secretary and his rival Mr Johnson.
Allies of Mr Hunt had urged MPs to choose the Foreign Secretary to help keep the party together rather than risk a ferocious row between Mr Johnson and Mr Gove.
"Boris and Michael are great candidates but we have seen their personal psychodrama before," a source said.
There has also been widespread speculation at Westminster that Mr Johnson's camp would attempt to engineer a way to prevent Mr Gove making the final pair – although the former foreign secretary denied being involved in any "dark arts".
In the fifth and final round of voting by MPs to whittle the field down to two, Mr Johnson again finished first, with 160 votes.
Mr Hunt regained second place, having lost it to Mr Gove in the fourth round of voting.
He secured 77 votes to get his name on the final ballot paper which will go to around 160,000 Conservative members who will choose the next prime minister.
Mr Gove was eliminated from the contest after receiving 75 votes.
Earlier on Thursday Sajid Javid's campaign ended after he received just 34 votes in the fourth ballot.
The final outcome of the leadership contest will not be known until the week beginning July 22, with the two remaining candidates taking part in a series of hustings in front of Tory members around the country before the votes are counted.