The former chancellor Mr Sunak and the Foreign Secretary Ms Truss finished in the top two places after five rounds of voting by Tory MPs at Westminster in the race triggered after Boris Johnson was forced out of Downing Street by a wave of ministerial resignations this month.
The result of the final round of MP votes was announced in the House of Commons, Mr Sunak topping the poll with 137, followed by Liz Truss on 113. Ms Mordaunt won 105 votes. Only four more votes could have swung the race.
In the previous round, Ms Truss attracted a significant 15 new backers, taking her to 86 votes and only six behind the early favourite Ms Mordaunt, whose vote base increased by 10 to 92. That gave Ms Truss the momentum to overhaul her rival's lead. Eleven candidates originally put their names forward.
Polls show Ms Truss would beat Mr Sunak in the party members' contest, creating the possibility that the Conservatives elect a leader who is not the most popular choice among politicians.
Mr Sunak is a former Goldman Sachs banker who has raised the tax burden towards its highest level since the 1950s, while Ms Truss is a convert to Brexit who has pledged to cut taxes and regulation.
Mr Johnson defended his time in government during his last Prime Minister's Questions and outlined advice for his successor.
Mr Johnson declared “mission largely accomplished”, before signing off by telling MPs: “Hasta la vista, baby.”
Conservative Party ballots are expected to arrive in early August, from the 180,000 members who are eligible to choose the next leader. A series of events involving the rivals will be held to showcase the choice to the members.
Allies of the former chancellor dismissed accusations that Mr Sunak’s team had encouraged supporters to vote tactically to ensure a run-off with Ms Truss, and said they were “absolutely not true”.
“Everybody who wanted to see Rishi through voted for him, there was a significant rise in our vote compared with yesterday,” party sources said, adding that a “robust policy debate” would be held in the next six weeks.
The electorate of members will consist of more men than women, with almost half aged over 65, studies show. About 95 per cent of the members identify as white British, while the vast majority are so-called ABC1s — those who are better off and in higher-salaried jobs.
Tory members are twice as likely to live in the south of England compared to the population of Britain as a whole.
It could hurt Mr Sunak that his resignation set in train the final demise of Mr Johnson, who was cheered and clapped by members of his party as he walked out of the House of Commons chamber for the final time as leader of the Conservatives.
In a closing address, Mr Johnson offered advice to his successor, who he said should "stay close to America" and "stick up" for Ukraine and global democracy.
He also urged the next British leader to "cut taxes and deregulate wherever you can to make this the greatest place to live and invest".
In a statement after her elimination from the contest, Ms Mordaunt congratulated her rivals.
“I pay tribute to anyone who puts themselves forward for such a demanding role,” she said.
“Politics isn’t easy. It can be a divisive and difficult place. We must all now work together to unify our party and focus on the job that needs to be done.”
Mr Sunak’s campaign team said he had secured a “clear mandate” from Tory MPs. They said he will now “work night and day” to win the backing of the Conservative membership.
Ms Truss thanked her supporters in a tweet. “Thank you for putting your trust in me," she said. “I’m ready to hit the ground from day one.”