KIEV, Ukraine -- Ukraine pulled back from the brink of chaos Friday when President Viktor Yanukovych signed a deal with opposition leaders to dilute his powers, form a caretaker government and hold early elections. But the accord appeared likely to be a hard sell among the thousands of demonstrators who vowed that nothing short of his ouster would get them off the streets.
The agreement represents a remarkable, humiliating fall for Yanukovych, whose decision to turn away from closer ties with the European Union and toward Russia sparked protests that began here peacefully in November but turned increasingly violent.
The atmosphere remained tense late Friday in Independence Square, the epicenter of the protests. When one of the opposition leaders, former boxing champion Vitali Klitschko, told the crowds this was the best deal they could get, one of the protesters grabbed the microphone and demanded that Yanukovych resign Saturday morning or face the wrath of the people.
"We will go with weapons," said the protester, who leads one of the more militant groups in the square. "I swear it."
The pact, reached after Ukraine's bloodiest week of street fighting, following all-night negotiations sponsored by European and Russian officials, calls for an immediate return to the 2004 constitution, which gives parliament, not the president, the right to choose a prime minister and most of the cabinet.
The accord also called for authorities and the opposition to refrain from violence and withdraw from public spaces, and to return the country to normal life. Protesters were to turn illegal weapons over to police.
In a move that sparked a roar of approval from protesters barricaded in Independence Square, the Ukrainian parliament approved, by a veto-proof margin, a change in the law that could lead to the quick release of jailed opposition leader Yulia Tymoshenko.
Tymoshenko, a former two-term prime minister and a founder of the largest opposition party here, was sentenced to seven years in prison in August 2011 for embezzlement and abuse of power over a deal to purchase natural gas from Russia. Her supporters have called her trial and conviction politically motivated.
In a rush to stem the violence, the Ukrainian parliament also sacked the interior minister, citing his "systemic and gross violation" of Ukraine's constitution for his orders to allow police to fire live rounds at protesters.
The ousted minister, Vitaliy Zakharchenko, who controls the nation's riot police, said security forces who shot and killed protesters were acting within the law and protecting retreating, unarmed police. "When an outrage is committed in the state and when attacks on the people and looting are spreading, when people don't know what to expect further, it is the people in uniform's duty to protect their citizens," Zakharchenko said before his removal.
Several Ukrainian outlets reported late Friday that Yanukovych had fled Kiev, the capital. In Washington, a senior State Department official said the president is believed to have traveled to Kharkiv, in eastern Ukraine, for meetings. The official said that after major announcements or developments "it's not unusual for him to go to the east, where his base is."
The deal between the opposition and Yanukovych calls for presidential elections no later than December, instead of March 2015 as scheduled. Many protesters say December is too late -- they want Yanukovych to resign immediately, and then face charges.
"I think people are preparing for the worst, for more to come," said Sergiy, a geography teacher from Lviv who is volunteering as a medic in a makeshift triage center at the October Palace, and who like others interviewed Friday declined to give his last name.
Sergiy said that Yanukovych cannot be trusted to hold elections in 10 months and would use the time to fortify his position and surround himself with cronies. The teacher said he also feared that opposition leaders were too ready to make a deal.
"We're afraid the politicians -- from both sides, yes, from the opposition, too -- will cheat us again," Sergiy said.
Arseniy Yatsenyuk, head of the opposition Fatherland party, tweeted before the signing that the deal must be approved "on the Maidan," as Independence Square is called, and would not take effect until that happens.
Protesters and mourners swelled into Independence Square on Friday to pray, sing hymns and the national anthem and pass from hand to hand the coffins of some of the protesters killed Thursday.
The total death toll from clashes reached 77, the Health Ministry said Friday, with 379 others hospitalized.
The violence and bloodshed clearly weighed on protesters' minds. "After the first shots were fired at us, that was it. Yanukovych is no longer our legitimate president. We're here until he is gone," said a mechanic who gave his name only as Vladimir.
His head was tightly bandaged from a bullet he said was fired at him by government snipers on Thursday. A friend, Dmitriy, said that "Yanukovych belongs in court, not in the president's office."
President Barack Obama spoke to Russian President Vladimir Putin about Ukraine for more than an hour, their first extensive conversation in months.
The White House said the two leaders "exchanged views on the need to implement quickly the political agreement reached today" but stopped short of saying they had agreed on all the elements of the deal. Obama and Putin also discussed the importance of stabilizing Ukraine's precarious economy "and the need for all sides to refrain from further violence," the White House said in a statement.
Also Friday, Secretary of State John Kerry spoke with three of the main Ukrainian opposition leaders to congratulate them for what the official called "courage and leadership" in helping reach agreement with the Yanukovych government. Klitschko was invited to join the telephone call with Kerry, the official said, but remained among opposition supporters on Independence Square instead.
"This is a very, very fragile agreement," despite the progress, and emotion remains high among opposition supporters, the U.S. official said.
One of the lead European negotiators, Polish foreign minister Radoslaw Sikorski, said, "This is the best agreement we could have and it gives Ukraine a chance to return to peace, to reform, and hopefully to resume its way towards Europe."
In less diplomatic language, Sikorski was caught telling an opposition leader to take the deal, warning "if you don't support this, you'll have martial law, the army. You will all be dead," in remarks captured by ITV News.
It is unclear what role the Russians played. Putin dispatched human rights commissioner Vladimir Lukin from Moscow on Thursday. Until now, Russia's lobbying of Ukraine has been so aggressive that Europeans have characterized it as bullying. But Lukin is a respected, low-key figure, and his appointment seemed to signal a change in the Kremlin's tone.
Yet Lukin flew back to Moscow before the signing. The Kremlin later said it was suspending its $15 billion aid program to Ukraine, signed after Yanukovych spurned a trade pact with the European Union in November.
"There is a chance of achieving peace in Ukraine. People are working on it," Lukin said, according to the Russian news agency Interfax. "But the situation there is very complicated and quite fluid, people you have to talk to are coming and going. The conversation will continue, including with our partners in Europe."
Leonid Slutsky, a Russian legislator who oversees relations with ex-Soviet states, told reporters Friday the deal is "entirely in the interests of the United States and other powers, who want to split Ukraine from Russia," according to the Associated Press.
Yanukovych announced via his website that Saturday and Sunday would be national days of mourning for the dead.
In a sign of the new power-sharing relationship, the same decree was announced by parliament.