Delaying Brexit to June 30 would bring "serious legal and political risks", the European Commission warned on Wednesday in an internal briefing note ahead of an EU summit.
Britain has asked to postpone Brexit to that date, but the commission, the EU's executive arm, urged leaders to choose instead between a short delay to May 23 or a longer one "at least until end 2019".
The European Council, which groups the member states, confirmed it had received the letter from British Prime Minister Theresa May asking for the delay, with leaders of the remaining 27 EU countries to decide on a possible postponement at their Brussels summit on Thursday and Friday.
May needs more time because her lawmakers have refused to approve the deal she struck with the EU to leave the bloc.
Elections to the European Parliament will be held on May 23-26, and the commission said that if Britain is granted a long delay, it must organise ballots.
"Any extension offered to the United Kingdom should either last until 23 May 2019 or should be significantly longer and require European elections.
"This is the only way of protecting the functioning of the EU institutions and their ability to take decisions," said the commission note, which was prepared on Wednesday morning before May's letter was received.
It will be for the leaders to decide on the length of the extension - and all 27 must give their approval - but the commission said they faced a "binary" choice: May 23 or the end of 2019 at the earliest.
"Any other option (as for example an extension until 30 June 2019) would entail serious legal and political risks for the European Union and would import some of the current uncertainties in the United Kingdom into the EU27," it warned.
If a long extension is granted, Britain must commit to "constructive abstention" in key EU debates such as the bloc's budget and appointments to the next commission, due to be constituted later this year.
This is to stop Britain using its veto to block EU business as a tactic to secure more Brexit concessions from Brussels.
In a similar vein, the commission said it must be made clear that if an extension is granted, it cannot be used to renegotiate the withdrawal agreement struck between the EU and Britain.