By Pavel Polityuk and Natalia Zinets
KIEV (Reuters) - Ukraine's parliament rejected Prime Minister Arseny Yatseniuk's resignation on Thursday and finally passed legislation he said was needed to finance an army offensive against a separatist rebellion raging in the east and avert a national default on its debts.
The assembly's about-turn on laws it refused to back a week earlier offers relief to Kiev's Western political and financial backers, who had feared Ukraine was sliding deeper into political chaos and might renege on the terms of an international bailout as it heads into a potentially bitter election campaign.
The political battle is taking place against the backdrop of a nearly five-month military conflict to take back parts of the Donbass region, which borders Russia, from the Moscow-backed rebels. Having recaptured the rebel stronghold of Slaviansk in early July, government forces are now moving on Donetsk and Luhansk.
In sharp contrast to the stormy parliamentary session last week at which the prime minister bellowed at legislators and accused them of betraying Ukraine's army and people by blocking reforms, deputies stood and applauded him after backing the amendments.
"There are two pieces of news today. The first is that Argentina has defaulted, and the second is that Ukraine has not defaulted and never will," Yatseniuk told the chamber, making clear he would stay in office.
President Petro Poroshenko said the votes in parliament would help Kiev in its fight against the separatists.
"We need consolidation, not confrontation," Poroshenko said before the vote. "We have to be united against external aggression."
Parliament's support for amendments to the 2014 budget was needed to take into account extra spending on the army and to release an additional 9.1 billion hryvnia ($758 million) (449 million pounds) to finance the military.
The government also wanted parliament to back legislation allowing consortiums with European or U.S. companies to operate the ageing gas distribution system.
Yatseniuk had said the government might default on debt payments and miss out on the release of further funds under a $17-billion International Monetary Fund bailout if it failed to pass the legislation.
"The laws the government is insisting on are unpopular and difficult, but very necessary," Poroshenko said. "The parliament's decisions are needed to enable the economy, the state as a whole, to function and for people to feel confident and protected."
Ukraine's economic decline has accelerated despite the international assistance, with the fighting in the industrial east taking its toll.
The exit of two parties from the ruling coalition last week amounted to the start of a campaign for seats in a legislature still packed with former allies of pro-Russian president Viktor Yanukovich, who was ousted by street protests in February.
Western governments have come to regard Yatseniuk as a key interlocutor during months of turmoil in the worst standoff between Russia and the West since the end of the Cold War. His departure would have been seen as leaving a political vacuum at the heart of decision making.
(Reporting by Pavel Polityuk, Natalia Zinets and Gabriela Baczynska, Writing by Timothy Heritage; Editing by Will Waterman)