Japanese Prime Minister Naoto Kan has survived a no-confidence motion brought by MPs critical of his handling of the earthquake and tsunami disaster.
Before the motion was debated, Mr Kan told his party he would step down when the crises were under control.
He was trying to head off a rebellion by senior members of his party which could have forced him from power.
March's disaster killed thousands of people and crippled the Fukushima Daiichi nuclear plant.
The BBC's Roland Buerk in Tokyo says Mr Kan has secured himself a few more months in power, but he has been left a weakened figure by the rebellion in his party.
When Mr Kan came to office last June, he was Japan's fifth prime minister in five years.
He has already survived several attempts by his opponents to force him to step down.
'Beyond party lines'
This time, senior figures in his Democratic Party of Japan (DPJ) had indicated they would support the no-confidence motion, increasing his chances of being forced out.
In a last-minute attempt to rally support, he urged a meeting of DPJ politicians to reject the no-confidence motion.
"I would like for the younger generation to take over various responsibilities once I fulfil certain roles that I need to, as I work on handling the disaster," he said.
Former Prime Minister Yukio Hatoyama - who had previously said he would support the no-confidence motion - said he would support Mr Kan.
The no-confidence motion was submitted by the main opposition Liberal Democratic Party (LDP), their smaller ally the New Komeito party and the Sunrise Party, and is expected to be backed by the Communist Party.
The LDP has accused Mr Kan of mishandling the reconstruction and relief efforts following the tsunami, as well as the Fukushima nuclear crisis.
In parliament on Wednesday, LDP leader Sadakazu Tanigaki told Mr Kan: "You have no personal virtues or ability to unite your own party members. I'm telling you to quit.
"Once you leave, there will be many ways for us to unite, to revitalise Japan beyond party lines."
Earlier this month, Mr Kan announced that Japan will scrap plans to increase its dependence on nuclear power.
But the result of an opinion poll published on Wednesday suggests the public has a dim view of Mr Kan's handling of the Fukushima crisis.
In a survey of 700 adults, 79% rated his management of the crisis as poor, according to the Pew Research Center.
On Wednesday, the UN nuclear energy agency the IAEA said Japan had underestimated the risk of a tsunami hitting a nuclear power plant.
But its response to the nuclear crisis that followed the earthquake and tsunami on 11 March was exemplary, the agency said.
The Fukushima Daiichi power plant, which was badly damaged by the tsunami, is still leaking radiation.