The embattled president of Ukraine, whose shift toward closer relations with Russia provoked the deadliest political crisis in his country's post-Soviet history, signed a compromise deal today that will diminish his power and watched helplessly as an emboldened parliament voted overwhelmingly to free his imprisoned rival.
The agreement signed by President Viktor Yanukovych and leaders of the opposition, commits him to early elections and reduces some presidential authority.
Although Russia declined to endorse the deal and many protesters - suspicious of the president's motives - said they wanted Mr Yanukovych to resign, opposition leaders said they hoped to persuade the skeptics and end the confrontation.
In a further sign of Mr Yanukovych's diminished influence, the parliament voted to allow the release of former Prime Minister Yulia Tymoshenko, who has been imprisoned for more than two years. In a 310-54 vote that is vetoproof, lawmakers decriminalised the actions for which she was incarcerated.
It was not immediately clear when Ms Tymoshenko might be released from a penitentiary in the eastern city of Kharkiv where she has been serving her sentence since August 2011. But she is still considered one of Mr Yanukovych's most potent adversaries. Many of her supporters blame Mr Yanukovych for ordering her imprisonment.
The English-language website of the Kyiv Post quoted a lawyer for Tymoshenko, Serhiy Vlasenko, as saying prosecutors must now file a petition to the court to release her, and the entire process could take up to two weeks. Ms Tymoshenko also would be able to run for office, since she will have no criminal record.
The parliament also approved a pivotal point in the political settlement by taking the first step toward reverting to a previous version of Ukraine's Constitution, which dramatically weakens the power of the president. With support from the pro-government party, the Party of Regions, that was required to vote with a constitutional majority, representatives annulled amendments to the constitution adopted after 2008, before Mr Yanukovych became president. The change was adopted with 386 votes, well above the 300 needed.
Lawmakers also passed an unconditional and blanket amnesty for all participants in the anti-government protests absolving those in custody or under investigation now and prohibit future prosecutions of protesters. They also voted to dismiss the minister of the interior, a reviled figure among protesters.
The votes came hours after word of the political deal reached between Yanukovych and the main opposition leaders. Radoslaw Sikorski, the Polish foreign minister and part of a European team that has been pushing for a settlement, said a council representing some protesters in Independence Square in Kiev, the focal point of months of protests, had endorsed the hard-fought deal in a vote, with 34 voting in favor and two against.
Arseniy Yatsenyuk, one of three opposition members of parliament who signed the accord with Mr Yanukovych, acknowledged that it might not go down well with protesters who want Mr Yanukovych gone, but said they could be persuaded. "We need to explain, and we need to not only explain, we need to act," he said after marathon negotiations at the presidential administration building mediated by European and Russian diplomats. "People will never trust any kind of signature. People will trust real action."
A bigger problem could be a refusal by Russia's representative to join the Europeans in signing the accord, which suggested that Moscow might work to undo the deal through economic or other pressure. "I am upset that the Russians are not signatories," Mr Yatsenyuk said.
"I am really upset."
Previous settlements and truces have broken down several times, engulfed by bursts of violence on the streets of Kiev, the capital, and in other parts of the country, particularly western regions where anti-government sentiment has always been strong.
But these previous deals were not reached with the high-level involvement of EU and Russian mediators, as was the case in the overnight talks Friday, which continued until the middle of the afternoon. A statement from Mr Yanukovych's office, issued before the signing, said the talks had been "very difficult."
The pressure for a political settlement has been intense, coming not only from foreign governments but also from a widespread fear among the population that this former Soviet republic of 46 million people was hurtling toward a possible civil war, particularly after frenzied violence yesterday that the opposition says killed more than 70 protesters.
Yestyerday was the most lethal day of political mayhem in Ukraine since independence from the Soviet Union more than 22 years ago. The violence escalated the urgency of the crisis, which began with protests in late November after a decision by Yanukovych to spurn a trade and political deal with the European Union and tilt the nation toward Russia instead.
As word of a deal spread today, many protesters responded angrily to the proposition that any settlement was possible until Mr Yanukovych left office. Many demanded that he be put on trial, along with officials whom protesters hold responsible for volleys of gunfire and attacks by snipers.
The deal reached today instead leaves Mr Yanukovych in power until at least the end of the year. It calls for early presidential elections in December, a swift return to a constitution of 2004 that sharply limited the president's powers and the establishment within 10 days of a "government of national trust."
"We don't want to wait until December," said Roman Kvasuk, an anti-government protester standing at newly reinforced barricade on Hrushevsky Street, a scene of frequent and bloody clashes with riot police officers. Mr Kvasuk was speaking as he and a group of fellow activists planned to walk up the street toward parliament, a move that risked drawing gunfire from jittery government forces responsible for protecting official buildings.
Yuriy Korshenko, a lawyer and former judge who joined thousands of others Thursday at Mikhailovsky Cathedral near Independence Square to show support for the protesters, said Mr Yanukovych must leave office immediately "or he will end up like Ceaucescu and Gadafy."
The Romanian and Libyan dictators, Nicolae Ceaucescu and Moammar Gadafy, were both killed in bloody uprisings against their rule. Korshenko added, "If Yanukovych were a man of honor, he would have already shot himself."
By late yesterday, the choices for Mr Yanukovych had narrowed to a stark dilemma between a massacre of protesters or negotiation: Exhausted and outnumbered riot police officers had withdrawn from their positions in front of the Cabinet building and the parliament, leaving 500 yards of eerily empty pavement between the last protest barricade near the Dynamo soccer stadium and the seats of power.
But the windows of the Cabinet building were fortified with sandbags to create firing positions onto the street below, the only option left to defend the building as talks continued through the night elsewhere in the capital with the opposition and the European and Russian envoys.
European officials greeted the news of an agreement with caution, with some indicating that it was premature to say an accord had really been reached. Laurent Fabius, the French foreign minister who helped mediate the talks, said much remained unresolved. "As long as things are not effectively completed, we must remain very prudent," he said, according to The Associated Press. "The opposition wants to consult a certain number of its supporters, which is understandable," Fabius said, according to the AP. "We discussed all subjects during these negotiations. It was done in an extremely difficult atmosphere, because there were dozens of dead and the country is on the verge of civil war."