European Union leaders have agreed to delay Brexit until 31 October, with a review in June, according to EU diplomats.
The decision has been taken at an emergency summit in Brussels tonight.
Earlier, British Prime Minister Theresa May signalled to other EU leaders that she was open to accepting a longer delay to Brexit if she could cut the extension short.
Mrs May spoke to the other 27 leaders for just over an hour before leaving the room to let them decide on the length of any extension and on whether they would attach conditions to it.
EU officials described Mrs May's address as "more solid than usual" but said it still lacked "many specifics" and that "leaders have many questions".
French President Emmanuel Macron had been pushing to withhold any commitment to extend Friday's deadline much beyond elections to the European Parliament on 23 May unless Mrs May committed herself, and any potentially more anti-EU successor, not to use the UK's final months to disrupt the workings of Brussels.
German Chancellor Angela Merkel was understood to favour an extension of "several months".
Other leaders, too, insisted they would not force the UK out against its will and Mrs May asked them to wait until 30 June as she sought help from her Labour Party opponents to build a majority in parliament in London behind her agreement for departing the EU.
"I want us to be able to leave the European Union in a smooth and orderly way as soon as possible and that's what I am going to be working for," Mrs May told reporters on arrival.
"I've asked for an extension to 30 June, but what is important is that the extension enables us to leave at the point at which we ratify the Withdrawal Agreement, so we could leave on 22 May and start to build our brighter future."
Summit chair Donald Tusk had proposed a flexible extension of nine months to one year to give the UK time to overcome a deadlock over parliament's refusal to ratify the treaty she agreed with the EU in November.
Mrs May has given herself an option to accept that by announcing she is ready to hold elections for the European Parliament on 23 May.
If Britons do not vote, the country must leave, deal or not, on 1 June, according to a draft summit agreement.
Otherwise, the UK would leave as soon as it ratifies the deal, or without one when the extension ends.
Taoiseach Leo Varadkar, said he was in favour of granting an extension as long as the Withdrawal Agreement, which contains the Irish backstop, was not re-opened, and Mrs May outlined a clear and credible plan for how she hoped to deliver on Brexit.