She went in with a plea to leave the EU in June, she came out with a deal for Halloween.
At 2.45am on Thursday morning, May used a brisk press conference to bleary-eyed journalists to insist she had secured a win – that Brexit day would now be delayed until October 31.
With that the cliff-edge no-deal exit, looming just 59 hours away on Friday, had been averted.
But at an uncharacteristically jovial summit, during which May seemed more at ease with other EU leaders (even sharing a joke with Angela Merkel), the PM performed a series of moves sure to anger hardliners back home.
The PM used the early hours press conference to acknowledge the “huge frustration” that she had been forced to extend Brexit again, and for so long. But in doing so, she also performed an impressive 180-degree turn, abandoning her own suggestion that she could resign if Brexit is significantly delayed.
But she refused to apologise, blaming MPs again by stressing “if sufficient members of Parliament had voted with me in January we would already be out of the European Union”.
Brexiteers at home will be seething, and as European Council president Donald Tusk remarked, it is “easier to build consensus here than in the House of Commons”.
But May at least avoided the acute embarrassment of past summits, having embarked on what the Germans dubbed a “begging tour” to Berlin and Paris to avoid any nasty ambushes.
Calls with 10 other EU leaders also meant Emmanuel Macron’s hardball approach threatening no deal was tempered by Tusk and Angela Merkel’s calls for the UK to be given more time.
The German chancellor even managed to draw a rare laugh from May with an image on her iPad as the PM faced the extreme pressure of an hour-long grilling by EU leaders over her plan.
The moment of lightness was caught on camera and was briefly the summit’s hottest story – until a Number 10 source revealed the pair were simply amused by a photo of them side-by-side wearing the same coloured blue jackets in their respective parliaments.
UK government sources said the PM used the session to stress exactly how far she is bending over backwards to try and find a way through the impasse by opening talks with Corbyn.
One said: “For some of her fellow leaders working across parties is more commonplace arguably than it is at home (in the UK) so it is a significant undertaking for her given our domestic politics to have said to the leader of the opposition - this is an open offer, sit down and talk.”
And despite scepticism about the usefulness of those negotiations with Labour, she told leaders that talks have been productive and worthwhile and could produce a passable deal in time for a June 30 exit, the source said.
Seeking to counter fears that a new Brexiteer PM could disrupt the EU during a lengthy delay to get better exit terms, May also highlighted the UK’s “sincere cooperation” since the Brexit vote in areas like clamping down on illegal immigration.
That avoided at least Macron’s drive to impose tough conditions on any delay, with May boasting that the UK would retain full member rights while it remained an EU leader, with Jean Claude Juncker even joking in response to Jacob Rees-Mogg’s threat that Britain being “difficult partners” was “nothing new”.
But her performance was not enough to convince EU leaders that only a short delay was needed, with a majority arguing for a longer extension over warm scallop salad, loin of cod with brown shrimps and mini mushroom arancini, and iced macadamia nut parfait.
The summit did not pass without a classic EU row between ‘the 27’.
Having his own ‘de Gaulle moment’, Macron arrived “impatient”, demanding “clarity” on how the Westminster deadlock will be broken, and threatening to push what was already an inconvenient summit long into the early hours.
As one diplomat remarked, the French president needed talking “down from his tree” as he backed May’s demand for shorter extension to June, fearing that a new Brexiteer PM could disrupt his plans for European renewal if Britain remained an EU member for too long.
A separate French presidency official said as talks dragged on: “A long extension is a problem, as the UK would be a member state with all the rights of a member state in the EU.
“We don’t want to import to the EU the British political crisis”
In the end Macron and EU leaders signed up to the October compromise which May accepted within an hour of returning to the summit after consulting Attorney General Geoffrey Cox by telephone.
The prime minister will be heavily quizzed by MPs on Thursday on how it came to pass.
And ringing in everyone’s ears will be Tusk’s final appeal: “Please do not waste this time”.