It could be a breakthrough in a months-long crisis over Ukraine's future and identity that worsened sharply this week and left scores dead in the worst violence in Ukraine's history as an independent country.
A key question is whether the thousands of protesters camped out in Kiev will heed it.
The leader of a radical group that has been a driver of violent clashes with police, Pravy Sektor, said Friday he doesn't believe President Viktor Yanukovych will honour the deal and "the national revolution will continue", according to the Interfax news agency.
The agreement says presidential elections will be held no later than December, instead of March 2015 as scheduled, according to a copy provided by the German government.
It says Ukrainian authorities will restore within 48 hours a previous constitution that limits presidential powers, then name a coalition government within 10 days.
It also says the government will not impose a state of emergency and both sides will refrain from violence. It says opposition protesters should hand over any weapons and withdraw from buildings they have occupied and protest camps around the country.
The signing came hours after President Viktor Yanukovych made concessions under pressure from European mediators.
Some protesters said talk of early elections in December is not soon enough -- they want him out of the presidency immediately.
European foreign ministers had stayed up all night in Kiev trying to negotiate an end to the standoff, prompted when the president aborted a pact with the European Union in November in favor of close ties with Russia instead.
An EU official in Brussels said that if an agreement is signed, Russia and the EU would act as observers to ensure that it is implemented.
The US, Russia and European Union are deeply concerned about the future of Ukraine, a country of 46 million that has divided loyalties between Russia and the West.
Shots were heard again Friday near the protesters' camp in Kiev, a day after the deadliest violence in Ukraine's post-Soviet history. It is unclear who was targeted and whether anyone was hurt or injured in Friday's incident.
Protesters across the country are upset over corruption in Ukraine, the lack of democratic rights and the country's ailing economy, which barely avoided bankruptcy with the first disbursement of a $15-billion bailout promised by Russia.
The violence is making Ukraine's economic troubles worse. The ratings agency Standard & Poor's downgraded Ukraine's debt rating Friday, saying the country would likely default if there were no significant improvements in the political crisis, which it does not expect.