Ms Truss overturned Ms Mordaunt's narrow lead in the final vote among Tory MPs, securing a place in the run-off by 113 votes to 105.
She will now go head-to-head with Mr Sunak, who topped the final ballot with 137 votes.
The winner will be decided by a vote among Conservative party members.
Foreign Secretary Ms Truss secured her place after a late surge in support, picking up 27 votes in the 24 hours since the last round whilst Ms Mordaunt only gained 13.
The two had been scrambling to secure the backing of MPs who had backed Kemi Badenoch, who was knocked out in Tuesday's vote.
Former Tory leader Iain Duncan Smith, a Truss supporter, said her campaign had "come with momentum at the end".
He added that her stance on post-Brexit regulatory reforms and plans to help those on low incomes had convinced colleagues to back her.
The campaign for Mr Sunak, the former chancellor, said his 137 votes were a "really strong result with a clear mandate from MPs".
Speaking to broadcasters, he said he was "humbled" to be in the final two, and said he was best-placed to "beat Keir Starmer at the next election".
Trade Minister Ms Mordaunt ran a campaign emphasising her support for Brexit and her ability to win Labour-held seats for the Tories.
Although she briefly served in Theresa May's cabinet, she has only held more junior positions under Mr Johnson and has boosted her profile considerably having started as one of the lesser-known candidates.
Tory MP George Freeman, one of her supporters, said she had come "from nowhere to fight a great campaign".
"We have lit a flame she is not going away," he added.
Mr Sunak, who quit as part of the cabinet mutiny against Boris Johnson, has repeatedly clashed with Ms Truss over economic policy during the leadership campaign.
Ms Truss has promised to introduce £38bn of tax cuts if she wins power, including scrapping April's rise in National Insurance, introduced by the government whilst Mr Sunak was still at the Treasury.
She has also pledged to cancel planned corporation tax rises from April 2023, which Mr Sunak announced in March last year.
But Mr Sunak has rubbished her proposals, saying the tax rises are needed to repair the public finances after Covid and accusing her of peddling "something-for-nothing economics".
He has said he wants to lower the tax burden, but this should only be done when inflation, currently running at its highest level for 40 years, has been brought under control.
Before Ms Mordaunt was knocked out, Sir Keir Starmer criticised the remaining contenders for making "unfunded" tax pledges worth billions of pounds.
Speaking at Boris Johnson's final Prime Minister's Questions, the Labour leader also said the leadership rivals had not had a "single decent thing to say" about the current government's record.
"I think the message coming out of this leadership contest is pretty clear - they got us into this mess, and they've no idea how to get us out of it," he added.
Although Mr Sunak has come first in all the voting rounds among Tory MPs, surveys have suggested he may struggle to maintain his advantage among members.
A YouGov survey of 725 party members on Monday and Tuesday suggested Mr Sunak would lose to either Ms Mordaunt or Ms Truss in a head-to-head.
The poll had Ms Mordaunt beating Mr Sunak by 51% to 37% and Ms Truss beating him by 54% to 35%.
A dozen regional hustings for members will take place between 28 July and 31 August, beginning in Leeds. Before that, Ms Truss and Mr Sunak will also go head-to-head during a live debate on BBC One next Monday.
The pair declined to take part in a live debate on Sky News earlier this week, leading to its cancellation, but have now agreed to take part in a debate hosted by the broadcaster on 4 August.
The roughly 160,000 Conservative members will then vote by post or online between early August and 2 September, with a winner announced on 5 September.
Rishi Sunak: I want to be honest about challenges we face
I've run a positive campaign, says Liz Truss