For the second time since Europe's migration crisis began last year, German Chancellor Angela Merkel has stunned her European Union partners by staking her political capital on a unilateral initiative and demanding their support.
After rolling out the welcome mat in September for Syrian refugees streaming into Europe, to the alarm of many European leaders who were not consulted, she has now gambled on a last-minute deal with Turkey to stop the migrant flow.
Whether that tentative bargain — improvised in the middle of the night a week before German regional elections in which her party faces losses — will turn out to be a breakthrough or a landmine in the migrant crisis remains to be seen.
Reaction at home to Merkel's Turkish gamble has been mixed. Top-selling Bild newspaper welcomed the deal with the headline "Ball in Turkey's court", but some of her own conservative lawmakers object to giving Turks visa-free travel in exchange.
German officials say it was Turkish Prime Minister Ahmet Davutoglu who surprised everyone by arriving at a meeting with Merkel and Dutch Prime Minister Mark Rutte in Brussels on Sunday night with a bold plan offering to take back all migrants who cross into Europe in return for political and economic rewards.
Merkel immediately sensed that the deal could "change the whole dynamic", a German official said, adding that the gains would far outweigh concessions the EU would make in return.
Davutoglu's price was a doubling of European money to keep Syrian refugees in Turkey, faster visa liberalization for Turks and accelerated EU membership talks for Ankara.
European Union diplomats and officials in Brussels were flabbergasted by the proposal sprung on them at a summit on Monday, with some irritated at having been kept in the dark during the preparations.
"Ask Mrs Merkel," one responded when asked how the idea of sending back all migrants, including Syrian refugees, to Turkey was compatible with international law.
European Council President Donald Tusk — who chaired Monday's summit — spent two days in Ankara and Istanbul last week meeting Davutoglu and President Tayyip Erdogan, working for a different deal, and was given little clue of what was coming.
Neither Tusk nor European Commission President Jean-Claude Juncker was invited to the Sunday night preparatory meeting.
Nor was France, Germany's closest European partner, which has minimized its commitment to take in refugees due to security fears since last November's Islamist attacks in Paris but also to the rise of far-right anti-immigration leader Marine Le Pen.
While Merkel took care to involve French President Francois Hollande in her diplomacy with Russia over Ukraine, she turned to Rutte this time as one of the few EU leaders willing to take in Syrian refugees directly from Turkey. Rutte also has a role in running the six-month Dutch presidency of EU meetings.
The proposal for a one-for-one swap in which Europe would admit one Syrian refugee from Turkey for each one the Turks took back from Greek islands — among the most contentious aspects of the draft deal — was first introduced by the Dutch. That left open how many might be brought to Europe — after Merkel found no takers for earlier German suggestions of accepting hundreds of thousands.
Diplomats said that when some leaders asked Tusk why he had not briefed them about the Turkish plan after his trip, he acknowledged that he had not known about the crucial offer to take back all migrants and refugees until Monday morning.
In fact, the former Polish prime minister was caught in a tug-of-war between Merkel and Austrian Chancellor Werner Faymann, who infuriated her by holding a conference of central European and Balkan countries last month, without Germany or Greece, to coordinate the closure of their borders to migrants.
"There was a race between Merkel's Plan A and the central Europeans' Plan B, which she suspected Tusk of supporting," one EU envoy said. "So Tusk was sidelined." Tusk was indeed pushing hard for a closure of the Balkan migration route and had secured broad support for that from EU envoys on Sunday afternoon.
Plan A, which Merkel called a "European solution", entailed persuading Ankara to stop migrants leaving its shores, returning those who do not qualify for asylum to home countries or to Turkey, and sharing out legitimate refugees among EU countries.
Plan B, reflecting scepticism that Ankara would deliver and exhaustion with continued arrivals, involved shutting borders across the Balkans and bottling up new migrants in Greece. For Tusk, that was a way of showing the Turks that if they did not halt departures, Europe would act alone and withdraw its offers.
Davutoglu's Plan C was more ambitious than either, but there are big doubts about whether it can be implemented, whether it will work and whether it is legal.
Impression of progress
Although Merkel denied domestic motives, the timing was helpful. The initiative offered a crucial sign of progress six days before votes in Baden-Wuerttemberg, Rhineland-Palatinate and Saxony-Anhalt on which her political future may be riding.
Heavy defeats for her Christian Democrats could weaken her and might raise question marks over her ability to lead the party into next year's general election, although her popularity is still high and no alternative leader is in sight.
The legality, enforceability and feasibility of Davutoglu's offer will only be tested after the state polls.
Officially, the European Commission is clinging to the line that a formal agreement with Turkey to be concluded at the next summit on March 17-18 will "at the end of it" comply with both European and international law.
Juncker said European law allowed the return of irregular migrants to any "safe" third country, but added that Greece and Turkey would need to amend some domestic rules.
EU insiders say for the proposed arrangement to be legal, Turkey would have to change the way it applies the Geneva Convention on refugees to include non-European nationals, and Greece would have to create a special court to hear asylum seekers' appeals against being sent back to Turkey.
Under EU rules, migrants are entitled to appeal against being returned to a third country on grounds of a risk to their life or safety there, but the court would not consider their claim for protection from their own country.
Merkel's embrace of the Turkish plan may pose political problems for Hollande, British Prime Minister David Cameron — struggling to win a referendum in June on staying in the EU in which immigration is a big issue — and Swedish Prime Minister Stefan Lofven, whose country is the most outspoken in the EU about Turkey's human rights record.
However, most fellow leaders are reluctant to resist Merkel, the EU's longest-serving national leader at the head of its most powerful member state, in her hour of political need.