LONDON (AP) — Britain’s Conservative Party on Wednesday chose former Treasury chief Rishi Sunak and Foreign Secretary Liz Truss — a fiscal moderate and a low-tax crusader — as the two finalists in a party election to replace departing Prime Minister Boris Johnson.

The result came just after the divisive, unrepentant Johnson, who has plunged his party into turmoil, ended his final appearance in Parliament as prime minister with the words “Hasta la vista, baby.”

Sunak and Truss came first and second respectively in a secret vote by Conservative lawmakers. Trade Minister Penny Mordaunt came in third and was eliminated.

The race, which has already produced bitter Conservative infighting, pits Sunak, who steered Britain’s economy through the pandemic before quitting Johnson's government this month, against Truss, who has led the U.K.’s response to Russia’s invasion of Ukraine.

The two contenders will spend the next few weeks campaigning for the votes of about 180,000 Conservative Party members around the country, who will vote by postal or online ballot. The winner of the party leadership vote will be announced Sept. 5 and will automatically become Britain's next prime minister.

Sunak won all four rounds of elimination votes by lawmakers, but is less popular with the party's grassroots, partly because of his previous job as Britain's chief taxman.

Truss, who has taken a tough line against Russian President Vladimir Putin — and with the European Union — is a favorite of the Conservatives' right wing.

Truss said if she becomes prime minister “I would hit the ground running from day one, unite the party and govern in line with Conservative values.”

Sunak's campaign said "the choice for members is very simple: who is the best person to beat Labour at the next election? The evidence shows that’s Rishi.”

The winner of the Tory contest will not have to face British voters until 2024, unless they choose to call an early general election.

The campaign has already exposed deep divisions in the Conservative Party at the end of Johnson’s scandal-tarnished three-year reign. Truss has branded Sunak a “socialist” for raising taxes in response to the economic damage wrought by the coronavirus pandemic and the war in Ukraine. Sunak has hit back, saying that rivals including Truss were peddling economic “fairy tales” to British voters as the country faces soaring inflation and economic turbulence.

Johnson allies have been accused of lobbying against Sunak, whose resignation helped bring the prime minister down, and in favor of Truss, who remained loyal. That impression was cemented Wednesday when Johnson said his advice to his successor would be not always to listen to the Treasury.

All the contenders —- there were 11 to start — sought to distance themselves from Johnson, whose term in office began boldly in 2019 with a vow to “get Brexit done” and a resounding election victory, but is now ending in disgrace.

Johnson quit July 7 but remains caretaker leader until the party elects his successor.

On Wednesday, he faced derisive opposition politicians and weary Conservatives at his last Prime Minister’s Questions session in the House of Commons, which adjourns for the summer on Thursday.

It was a downbeat departure, with supportive Conservative lawmakers lobbing praise and opposition politicians offering variations on “good riddance.”

Johnson extolled what he called his accomplishments — leading Britain out of the EU and through COVID-19, and supporting Ukraine against Russia's invasion — and declared: “Mission largely accomplished, for now," before departing with Arnold Schwarzenegger's “hasta la vista” catchphrase from “Terminator 2.”

Opposition Labour Party leader Keir Starmer said: “I will miss the delusion.”

Johnson clung to office through months of scandals over his finances and his judgment, refusing to resign when he was fined by police over government parties that broke COVID-19 lockdown rules. He finally quit after one scandal too many — appointing a politician accused of sexual misconduct — drove his ministers to resign en masse.

Despite remaining prime minister, he has largely disappeared from the scene, even as Britain faces a summer cost-of-living crisis and labor discontent as inflation hits 9.4%.

Johnson did not attend any government emergency meetings about the heat wave that brought record temperatures of 40 degrees Celsius (104 Fahrenheit) to Britain this week. Last week he took a ride in a Royal Air Force Typhoon fighter jet, with “Top Gun”-style footage released by his office, then threw a weekend party at Chequers, the country house that comes with the prime minister’s job.

London Mayor Sadiq Khan accused Johnson of wanting to “become Tom Cruise” and urged him to resign immediately.

“We need a full-time prime minister looking after our country rather than somebody who’s checked out,” Khan said.

___

Follow all of AP’s coverage of British politics at https://apnews.com/hub/boris-johnson

Copyright 2022 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.