The EU could extend Britain's membership until next summer.

Officials in Brussels reportedly believe it would provide enough time for the fallout from a general election to play out, or to legislate for a second referendum.

Boris Johnson insists that the UK will leave the EU on October 31, but talks appear close to collapse and the law compels him to seek an extension later this month if he is unable to secure a deal.

The government's ultimate position on Brexit appears likely to become clear on Saturday, October 19, when it will call MPs to Westminster for a special sitting day in the aftermath of the EU Summit on October 17 and 18, according to the BBC.

LONDON — The European Union could extend Britain's EU membership until as late as next summer, paving the way for a possible second referendum on Brexit.

Prime Minister Boris Johnson is compelled under UK law to seek a Brexit extension beyond October 31 later this month if he has failed to agree a deal with the EU.

With talks between London and Brussels on the verge of collapse, thinking in EU capitals has turned to how long to extend the Brexit deadline.

Legislation passed by the UK parliament last month states that the prime minister must seek an extension until at least January 31 2020. However, officials in the EU are worried that would not provide enough time for a new government to resolve its Brexit position ahead of a likely general election later this year, the Guardian reports.

Read more: EU accuses Boris Johnson of playing a 'stupid blame game' as the UK says a Brexit deal is now impossible

Read more: Boris Johnson will delay Brexit rather than resign as prime minister

The newspaper reports that June has been floated as a natural cut-off date because a vote on the EU's 7-year budget is not likely to arrive until June or possibly later. Downing Street officials, in a bid to prevent the EU from granting an extension, have warned that the UK could wield its veto on the budget as a means of being obstructive.

Crucially, the June cut-off date would also provide enough time for the UK parliament to legislate for a second Brexit referendum.

The Irish Prime Minister Leo Varadkar, is chief among those EU leaders holding out for the prospect of a second referendum.

"All the polls since Prime Minister Johnson became prime minister suggest that [a second referendum] is what the British people actually want, but their political system isn't able to give them that choice," he said last week.

A consistent majority of British people believe the decision to leave the EU was a mistake, according to long-running polling by YouGov.

Momentum builds for a second referendum

Support for a second Brexit referendum in the UK parliament has increased in recent months, after the opposition Labour party, which holds the second largest bloc in the parliament, moved to back a new vote.

BBC Newsnight reported on Tuesday that there will be a "big push" from opposition MPs to get a second Brexit referendum onto the statute book once Brexit is delayed.

Former Conservative MP Amber Rudd, who resigned from Cabinet in September, came out in support of a so-called People's Vote this week, with more Conservative MPs set to follow if Johnson comes out explicitly in favour of a no-deal Brexit.

Brexit talks close to collapse

Talks about a possible Brexit deal were close to collapse on Monday after Downing Street made extraordinary claims about the content of a phone call between the prime minister and German Chancellor Angela Merkel.

An unnamed Number 10 official claimed that Merkel told Johnson that Northern Ireland had to stay in the EU's customs union, which the source claimed meant a deal now looked "essentially impossible, not just now but ever."

Donald Tusk, the European Council president, gave an insight into the extraordinary level of anger about the reported details of the phone call, which senior German politicians described as "improbable."

"What's at stake is not winning some stupid blame game," he wrote in a tweet addressed directly to Boris Johnson.

"At stake is the future of Europe and the UK as well as the security and interests of our people. You don't want a deal, you don't want an extension, you don't want to revoke. Quo vadis? [Where are you going?]"

The government's ultimate position on Brexit appears likely to become clear on Saturday, October 19, when it will call MPs to Westminster for a special sitting day in the aftermath of the EU Summit on October 17 and 18, according to the BBC.