Ukrainian Prime Minister Arseniy Yatsenyuk's government has survived a no-confidence vote hours after the president asked him to step down.
The prime minister has been criticised over the slow pace of reforms and faces allegations of corruption.
Earlier, President Petro Poroshenko said the PM had lost the support of the coalition and the country's trust.
Mr Yatsenyuk's public support has eroded amid Ukraine's economic problems.
The no-confidence motion required 226 votes to pass in parliament, but only 194 out of the 339 MPs supported it.
This means the government will probably be safe at least until the next parliament session starts in September.
The decision came moments after lawmakers voted the cabinet's work in 2015 unsatisfactory.
In a passionate speech to parliament earlier, Mr Yatsenyuk said his government, which is backed by Western countries, had done all it could under difficult circumstances.
"We have built the foundations for a new country. Let's build a new Ukraine: do not stop. Reforms are the only way forward," he said.
Hundreds of demonstrators had gathered outside parliament in Kiev during Tuesday's session to protest against government policies.
Troubles from start
A former speaker of parliament and foreign minister, Mr Yatsenyuk was one of the main opposition leaders during the massive protests that removed former pro-Russia President Viktor Yanukovych in 2014.
Only two weeks after Mr Yatsenyuk took up his post, Russia annexed Crimea and, soon after, a violent pro-Moscow insurgency raged in the industrial east, where a one year-old ceasefire agreement has failed to stop the conflict.
On the economy, despite being credited with helping negotiate a rescue package with Western countries, there has been growing public discontent with the lack of progress.
Recent opinion polls suggest that support for Mr Yatsenyuk's bloc is at 1%.
Analysis: BBC's Tom Burridge in Kiev
So Ukraine's increasingly fractured government wins one vote and loses another. Crucially it won the no-confidence vote, so at least for now the government survives.
On the face of it, the already uneasy relationship between the prime minister and the president became even more complicated, after President Poroshenko called on PM Yatsenyuk to step down.
But in some sense Mr Poroshenko seems to be playing a double game, because many MPs from his own party voted to keep the current government.
The complex machinations of Ukrainian party politics are complicated further by pressure from outside forces, namely the International Monetary Fund, which has bailed Ukraine out, and the European Union, which has plunged considerable amounts of financial and technocratic support into the country.
Those outside forces have grown increasingly cynical about the ability of the Ukrainian government to carry out reforms to rout out corruption, after two high-profile reformers resigned from public office.
So the government lives on, but instability remains and you cannot rule out some form of change, within the government.
Mr Yatsenyuk has promised to tackle corruption, but has become the focus of similar accusations, although no concrete evidence has emerged.
He has also faced infighting, which culminated with Mr Poroshenko's call for his resignation on Tuesday. The president said "surgical means" were needed to restore trust.
Mr Poroshenko heads Ukraine's largest party, and Mr Yatsenyuk the next largest, and both are in the ruling coalition.
The government now faces the challenge of implementing changes required to secure a massive international aid package.
The International Monetary Fund (IMF) has threatened to withhold aid money to Ukraine if it does not carry out reforms.
Western governments have previously expressed concern over the resignation of reform-minded figures.
Economy Minister Aivaras Abromavicius stepped down earlier this month, claiming that huge quantities of money were being diverted from the government.
Also on Tuesday, the country's controversial prosecutor general Viktor Shokin resigned, following a call from Mr Poroshenko for him to do so.