The UK has been granted a six-month extension to Brexit, after five hours of talks in Brussels.
The new deadline – 31st October – means that the UK will not necessarily have to leave the EU without a deal on Friday, as MPs are still deadlocked over a deal.
“Please do not waste this time,” European Council president Donald Tusk told his “British friends”.
"The course of action will be entirely in the UK's hands. They can still ratify the withdrawal agreement, in which case the extension can be terminated."
Mr Tusk said the UK could also rethink its strategy or choose to "cancel Brexit altogether".
UK Prime Minister Theresa May, who had wanted a shorter delay, said the UK would still aim to leave the EU as soon as possible. "I know that there is huge frustration from many people that I had to request this extension," she said.
"The UK should have left the EU by now and I sincerely regret the fact that I have not yet been able to persuade Parliament to approve a deal."
The UK must now hold European elections in May, or leave on 1st June without a deal.
European Commission President Jean-Claude Juncker said: "There will probably be a European election in the UK - that might seem a bit odd, but rules are rules and we must respect European law and then we will see what happens."
Prime Minister May confirmed that the UK "will continue to hold full membership rights and obligations" of the EU during the delay.