EU leaders have offered the UK a plan which would delay Brexit from March 29 to May 22, on condition that MPs approve Theresa May’s withdrawal deal in a vote next week.
If the deal is rejected in its third “meaningful vote” in the Commons, the UK would be given until April 12 to come to the European Council with its proposals for the way forward.
The possibility would be open for a further extension of several months if the UK agreed to take part in European Parliament elections in May.
European Council president Donald Tusk said that the response to Britain’s request for an extension to the Article 50 withdrawal process was agreed “unanimously” by leaders of the other 27 member-states.
The Prime Minister said: “What the decision today underlines is the importance of the House of Commons passing a Brexit deal next week so that we can bring an end to the uncertainty and leave in a smooth and orderly manner.
“Tomorrow morning I will be returning to the UK and working hard to build support for getting the deal through.”
Mr Tusk said that April 12 was a “key date” for the UK because if it decided not to participate in the European Parliament elections then a long extension would become impossible.
Mrs May said “it would be wrong to ask people in the UK to participate in these elections three years after voting to leave the EU”.
He said: “April 12 is a key date in terms of the UK wondering whether to hold European Parliament elections.
“If it is not decided do so by then the option of a long extension will immediately become impossible.”
Mr Tusk added: “In regards to the extension our decision envisaged two scenarios.
“In the first scenario, that is if the agreement is passed next week, the European Council agrees an extension to May 22.
“In the second scenario, if the agreement is not approved, the European Council agrees an extension until April 12 while expecting the UK to indicate a way forward.
“What this means in practice is that until that date all options remain open.”
Asked how long the “long extension” eventually on offer to the UK could be, European Commission President Jean-Claude Juncker replied: “Until the very end.”
Mr Juncker said: “Since the day of the referendum the position of the 27 members of the European Commission has been united and unequivocal.
“We have worked tirelessly to negotiate the Withdrawal Agreement.
“We have done everything we could to get it over the finishing line.
“We were asked for clarifications in December, we gave it to them.
“We were asked for assurances in January, we gave it to them.
“I was asked for further reassurances last Monday in Strasbourg, notably with regard to the backstop, I gave it to them.
“So I have to welcome that today, the 27 leaders endorsed the legally bonding clarifications and assurances that Prime Minister May and I agreed in Strasbourg.
“This closes and completes the full package. There is no more that we can have.”
Mr Tusk said: “The fact that we are still able to find, not the final solution, but the way to at least ease the process for both sides, I think it was very very tangible and visible.
“I’m satisfied especially that we have open so many options.”
The so-called “flextension” plan was drawn up in a meeting stretching over eight hours at an EU summit in Brussels, as EU27 leaders wrangled over possible final cut-off dates for Brexit.
The format increases pressure on Leave-backing MPs to row in behind Mrs May’s deal, for fear that if it falls the UK could find itself electing new MEPs and remaining for month or years within the EU.
But it also creates a breathing space of a fortnight if Mrs May reaches the end of next week without securing agreement for her package, or if Speaker John Bercow prevents her from tabling a motion which he regards as a repeat of those already defeated by 230 votes in January and 149 votes last week.
Parliament could use that time to try to take control of the process and force Mrs May towards a softer Brexit stance or second referendum.
The bulk of the meeting took place behind closed doors in Mrs May’s absence, after her plea for a longer extension to June 30 fell on deaf ears.
Mrs May had to leave the room after making her case in a 90-minute presentation to her European counterparts.
The Prime Minister was reportedly pressed on what she will do if MPs reject her deal for a third time but did not commit herself to a Plan B or rule out a no-deal Brexit.