Japanese Prime Minister Shigeru Ishiba kept his job in a parliamentary vote on Monday, despite having led the ruling coalition to its worst general election result in 15 years.
Lawmakers appointed former defence minister Ishiba head of a minority government -- meaning he may face political gridlock, or need to compromise to pass new bills.
Ishiba took office six weeks ago and held a snap election on October 27, hoping to shore up his mandate as leader of the conservative Liberal Democratic Party (LDP).
But voters, unhappy with inflation and a slush fund scandal that helped sink his predecessor Fumio Kishida, delivered a ballot-box blow to the LDP and its junior coalition partner.
MPs in parliament's powerful lower house convened on Monday for a special four-day session to nominate the prime minister, a necessary step after a general election.
Japan's opposition parties are divided on key issues, stopping them mounting a credible challenge to Ishiba.
In a run-off -- the first since 1994 -- Ishiba won 221 votes against 160 for Yoshihiko Noda, head of the main opposition Constitutional Democratic Party of Japan (CDP). Eighty-four votes were discounted because they named other politicians.
"This chamber names Shigeru Ishiba... as the prime minister," announced lower house speaker Fukushiro Nukaga, as Ishiba bowed to his fellow lawmakers who applauded.
Despite losing its majority in the October election, the LDP coalition remains the largest bloc in the 465-seat lower house.
The prime minister will announce a new cabinet later on Monday, who will be ceremonially approved by the emperor.
- Trump 'headache' -
To have enough sway to pass legislation going forward, the ruling bloc has asked for help from the Democratic Party for the People (DPP), a small centrist group.
The DPP has agreed to cooperate on a vote-by-vote basis while staying out of the coalition.
In talks with the LDP, it has demanded tax cuts and energy subsidies that economists say would slash the government's revenues.
"In order to stay in power, Ishiba needs to pass the government budget this winter," Tomoaki Iwai, professor emeritus at Nihon University, told AFP.
"It will mean the LDP will have to concede some of its policies to seek cooperation from others," Iwai said.
Ishiba, 67, is reportedly trying to arrange a meeting with US president-elect Donald Trump later this month, around the time he travels to Peru for an economic summit.
Analysts have voiced worries that possible fresh US tariffs on Chinese and Japanese goods under Trump may fuel inflation.
The Trump administration may also demand that Japan hike its defence spending, or push Japanese firms to expand their factories in the United States.
"It must be Mr. Ishiba who is feeling the toughest headache of Mr. Trump's victory," Hideo Kumano, chief economist at Dai-ichi Life Research Institute, wrote in a note.
Washington and domestic lawmakers are likely to press him for higher public spending and tax cuts at the same time, Kumano explained.
- Affair scandal -
Approval ratings for Ishiba's government are just above 30 percent, but polls show a majority of the public say he should remain prime minister.
In a twist, DPP head Yuichiro Tamaki on Monday admitted to an extra-marital affair reported by a tabloid.
"I apologise for causing such a disturbance," he told reporters. His party later decided to keep him on as leader.
Along with these negotiations, Ishiba must also contend with discontent within his party.
The LDP, which has ruled Japan for almost all of its post-war history, lost dozens of seats -- including ministers -- in October's election.
"Unless he improves his public support, those inside the LDP may start saying they cannot fight the upper house election under Ishiba" next year and look for another leader, Iwai said.
Noda vowed last week that the CDP would "work hard so we will make significant gains in the upper house election" in July.