First and foremost, thanks to mass defections from Yanukovych’s Regions Party, the opposition won the majority in parliament that had previously eluded it: On Thursday night, 236 out of 450 deputies voted for a resolution calling on all armed forces to stop shooting on protesters and to return to their barracks. Before the protests started, the three democratic opposition parties had only 168 votes, but now they have gained 68 more votes from independents and defectors from Yanukovych. This shift of power in parliament has made all the other changes possible.

The defectors are largely big businessmen and their representatives in parliament. Many of Yanukovych’s more odious loyalist lawmakers fled the country, and the protesters blocked the Kiev airport Thursday evening to make sure that they could no longer flee. Yanukovych’s power base is finally disintegrating.

The immediate cause of these mass defections was the great tragedy of the previous three days. The special Interior Ministry police, known as the Berkut, killed dozens of protesters on Maidan, the main public square in Kiev. The violence was so counterproductive that one wonders whether President Yanukovych had lost his mind, control, or both. Whatever the case, he has lost the trust necessary to stay in power. A few days earlier former President Leonid Kuchma stated that in his worst nightmares he could not have anticipated such bloodshed in Ukraine, and it was unacceptable for it to continue. He was criticizing Yanukovych in all but name.

Also on Thursday, the EU Council of Foreign Ministers decided to impose visa and financial sanctions on Ukrainian officials responsible for the violence. The list of officials has not yet been established, but the decision has sent a message that those Ukrainian culprits who have stolen from the state and private businessmen may be brought to justice. Presumably, much of this stolen wealth is held in Europe.

While the bottom was dropping out from under the Ukrainian president, three EU foreign ministers—from Germany, France, and Poland—spent hours negotiating with him to make to major concessions. In the view of most Ukrainians, Yanukovych has forfeited his presidency through multiple criminal acts and without legitimacy he can make no relevant compromises. The only relevant discussion with him can be about the end of his regime and his personal exit. The EU ministers did not go quite that far, but almost.

On Friday, February 21, Yanukovych finally made substantial concessions in negotiations with the three opposition party leaders mediated by the EU ministers. The agreement consisted of six points.

First, the agreement called for parliament to adopt a special law to restore the constitution of 2004. Parliament did so later in the day with 386 votes, far more than the required two-thirds majority of 300 votes. Yanukovych’s defeat was so complete that he ordered his own deputies to vote in favor of this move, which reversed his own illegal act of October 1, 2010, ordering the Constitutional Court, which he controls, to abolish the 2004 charter and revert to the constitution of 1996 granting him sweeping powers. As in the preceding evening, the parliamentarians stood up and sang the national anthem after their vote. The signatories also declared their intention to create a coalition and form a national unity government within 10 days.

Important as these moves are, the 2004 constitution requires substantial technical improvements. Therefore, the second point of the agreement mediated by the European Union is that the constitution will be improved and a new constitution is to be adopted in September 2014, which is a realistic time frame.

The third agreement was that presidential elections would be held after the new constitution has been adopted but no later than December 2014. Naturally, a new constitution needs to be in place before new presidential elections. Also new electoral laws will be passed and a new Central Election Commission is to be formed on the basis of proportionality.

The fourth point calls for the recent acts of violence to be investigated jointly by the authorities, the opposition, and the Council of Europe, Europe’s human rights organization.

The fifth point was a guarantee by the authorities not to impose a state of emergency, and both sides committed themselves to abstaining from acts of violence. The parliament will adopt a third law of amnesty, which will presumably cover all protesters. Already on Friday, the parliament has adopted a law against any prosecution of arrested protesters. This law was passed with a majority of 372 votes.

At the time of this writing, it is unclear whether the protesters’ leading body, the Maidan Council, will approve this agreement. It goes far to please opponents of Yanukovych, but they might also see it as a salvation or respite for him. The leader of the radical Pravy Sektor (the Right Sector), Dmitry Yarosh, noted that the declaration does not contain anything about the resignation of Yanukovych, the dissolution of the parliament, or the arrest of the Minister of Interior Vitaly Zakharchenko and the police chief.

But the opposition has a majority in parliament now, and they can decide for themselves. Their majority will quickly increase as the Regions deputies defect in droves. Also on Friday, the parliament voted to oust the much-hated Zakharchenko. It voted with 310 votes to adopt a law freeing former Prime Minister Yulia Tymoshenko, which sends the signal that the parliament can overrule a presidential veto. A coalition government with Yanukovych loyalists could be poison for opposition politicians, but now a national unity government would probably only contain opposition and defectors from Yanukovych’s camp.

The opposition majority in parliament reached a tipping point Thursday night. Yanukovych and his loyalists are on the run. Now, the parliament is poised to adopt one important law after another. Hopefully, violence will end and large armed forces have already withdrawn from Kiev. A more sensible constitution is already in place. Yet, the big negotiation about the exit of Yanukovych remains at the top of the agenda.

As during the Orange Revolution of 2004–05, the European Union has provided the critical mediation services, while both Russia and the United States have been little more than bit players. President Vladimir Putin’s aggressive gamble to draw Ukraine into Russia’s sphere of influence and into the Eurasian Union, widely hailed as a brilliant move, has suffered a serious setback, hopefully to the benefit of European values.

Anders Åslund is a senior fellow at the Peterson Institute of International Economics in Washington, D.C.