The leaders of the EU rejected May’s request to extend the 29 March Brexit deadline to 30 June, and instead gave her until 12 April to persuade parliament to endorse a deal she brokered with the bloc's leaders late last year.
If May can get lawmakers to back the agreement, the UK will have until 22 May to exit the EU. European parliament elections are due to be held the next day.
At a long summit meeting in Brussels that stretched through dinner on Thursday, May assured European leaders that she could win a vote in parliament.
EU summit host Donald Tusk expressed relief that the deadline had been extended.
"I am really satisfied, especially that we have still open so many options," he said. "It is a good sign."
"Now it is finally up to the British political system to provide a clear answer," said French President Emmanuel Macron. "The European Union is not holding all the cards because everything depends on the British vote.”
- Eye on France: Make or break for Brexit
- European Commission warns against May's short Brexit delay
- EU says Britain would need a good reason for delaying Brexit
Britain’s parliament has twice rejected the deal. May plans to make a third attempt to get it passed next week, but the House of Commons is split, both among and within its political parties, over whether and how to leave the EU.
May said that if the deal falls a third time by 12 April, "we would either leave with no deal, or put forward an alternative plan" that involved participating in EU parliament elections.