* Deal forsees early elections and national unity government
* Yanukovich unsmiling during signing ceremony
By Sabine Siebold
KIEV, Feb 21 (Reuters) - Ukrainian President Viktor Yanukovich on Friday signed an agreement with three opposition leaders on ending a crisis that sparked bloody clashes between protesters and police on the streets of the capital Kiev.
The deal sets out plans to hold early presidential elections, form a national unity government and revert to the 2004 constitution, removing some of the president's powers.
A Reuters correspondent at the signing in the presidential headquarters said Yanukovich did not smile during a ceremony lasting several minutes but he did shake hands with the opposition.
Before the ceremony in the ornate Blue Hall of the presidential headquarters, former boxer Vitaly Klitschko swapped place names so that he did not have to sit next to Yanukovich.
The deal was also signed by two European Union foreign ministers who helped broker it in tortuous negotiations that lasted more than 30 hours.
"This agreement is not the end of the process. It's the beginning of the process," German Foreign Minister Frank-Walter Steinmeier said after the signing.
He said it was not perfect but the best agreement that could have been reached.
"With it Ukraine has got the chance to resume its way to Europe," he said.
"This is a landmark decision for a change to the dictatorial powers of President Yanukovich," another opposition leader, Arseny Yatsenyuk told parliament.
The assembly subsequently began to vote to make the agreement law, supporting immediately a return to the constitution of 2004 and an unconditional amnesty for people detained in the current unrest.
The crisis began after Yanukovich spurned a political and trade pact with the European Union in November and decided to rebuild trade ties with Russia instead. That triggered protests in central Kiev and violence, including clashes in which 77 people were killed this week in the capital.
The deal was not signed by Vladimir Lukin, an envoy sent by Russian President Vladimir Putin. There was no immediate explanation for his absence.