Jeremy Hunt has beaten Michael Gove to second place in the final leadership ballot by just two votes.
He won 77 votes compared to Mr Gove’s 75.
Mr Gove trailed Mr Hunt in the first and second ballots, only to take the lead in the third round of voting.
But Mr Hunt wrested back control in the final ballot and will challenge Boris Johnson in the final stage of the contest.
Mr Johnson gained supporters with every ballot, from 114 in the first round to a final tally of 160.
He only added three supporters in the final round of voting.
On Twitter he said he was "deeply honoured to have secured more than 50 per cent of the vote in the final round".
The other contenders have also released brief statements on Twitter.
Mr Gove said he was "naturally disappointed" with the result but proud of his campaign.
Mr Hunt said he remains the "underdog" and is aware of the "responsibility on my shoulders".
Ousted leadership contenders Sajid Javid and Rory Stewart refused to say who they backed in the final ballot.
Mr Stewart confirmed he was not one of the two MPs who spoiled their ballot in the 1pm vote.
The final two will now start travelling across the country for a series of hustings events to convince Conservative Party members.
There are around 160,000 party members, and they all get a vote.
The next important date is July 22, when members are expected to have sent in their postal vote.
The 1922 Committee of Tory backbenches may announce the next Prime Minister as early as the next morning.
Theresa May could then immediately resign as Prime Minister and hand the reins to her successor, or allow for a brief transition period.
FOURTH ROUND TALLIES
Boris Johnson - 160
Jeremy Hunt – 77
Michael Gove – 75 (eliminated)