Updated

The parties behind Ukraine's Orange Revolution agreed Wednesday to form a coalition government, ending three months of tense talks to preserve a pro-Western government that has sought to shed Russia's influence.

As part of the coalition deal, President Viktor Yushchenko's Our Ukraine bloc agreed to give the prime minister's job back to Yulia Tymoshenko, his former Orange Revolution ally whom he fired last year amid mutual accusations of corruption and incompetence.

The agreement between Our Ukraine, Tymoshenko's bloc and the Socialists gives them a 243-seat majority in the 450-member parliament, said Roman Bezsmertny, the lead negotiator for Yushchenko's bloc. The deal ends nearly three months of political uncertainty following March parliamentary elections that did not give any party enough votes to form a majority on its own.

The prime minister's position had been a key stumbling bloc in coalition talks between the three parties whose 2004 Orange Revolution protests swept Yushchenko into office.

The Orange alliance fell apart in September when Yushchenko fired the charismatic Tymoshenko. But she bounced back in the March elections, winning more votes than her potential coalition partners combined. The impasse was resolved when Yushchenko met with the leaders of the three parties late Tuesday.

"We won democracy for Ukraine," Tymoshenko told parliament. "The very creation of the coalition defines Ukraine's course for many years ahead and will move Ukraine into the European community."

Tymoshenko's return to the premiership could bring back some of the populist policies that saw pensions raised and state salaries paid on time. Her previous stint, however, also saw increased tensions with Moscow and other members of Yushchenko's team.

Yushchenko had resisted giving Tymoshenko her old job back, but the alternative was forming a coalition with pro-Russian party of Viktor Yanukovych, whose fraud-tainted election victory in 2004 sparked the Orange Revolution protests.

Yushchenko's bloc had announced last week it was reaching out to Yanukovych's Party of Legions, further complicating the coalition talks. Yanukovych sat frowning as Bezsmertny announced the coalition deal in Parliament on Wednesday.

The Party of Regions, which dominates in the Russian-speaking east and south, won the most votes in March elections.

Yushchenko's pro-Western government had become unpopular since his election because of political infighting and disillusion with the struggling economy. Some had said forming a coalition with Yanukovych's party could help heal the divisions between the former Soviet Republic's Ukrainian-speaking west and the largely Russian-speaking east.

Yevhen Kushnarev, a leading member of Party of Regions, told lawmakers his party wouldn't try to block the formation of the Orange coalition, but predicted it would fall apart.

"Ukraine has no future under one color," Kushnarev told the parliament session. "Each of us expresses the interest of only part of the Ukrainian people. Separately we won't be able to unite Ukraine, bolster the economy or improve Ukrainians' lives."