BRUSSELS (Reuters) - If Britons vote to leave the European Union in their June 23 referendum, Prime Minister David Cameron can effectively file the divorce papers in person to fellow EU leaders the next morning in Brussels.

Just how he will arrange his diary, having scheduled the vote on the first day of the regular midsummer EU summit, is not yet clear; from then on, the process of “Brexit” will only get messier, as Europe’s fractious leaders haggle their way through an unprecedented break-up that could take years to complete.

Article 50 of the Treaty of the European Union lets a state quit and sets a deadline to negotiate terms within two years. If by mid-2018, Britain has not agreed issues like trade terms or the status of foreign residents, its membership will simply end -- unless it and all 27 other EU states agree an extension.

Cameron’s government said this week, however, that rewriting British laws post-Brexit and renegotiating relations in trade and other fields could take a decade, with an EU divided over other crises and smarting from Britain’s rejection.

No one has a clear idea how events will unfold once voting ends at 10 p.m. (2100 GMT) on Thursday, June 23. Instant exit polls will deliver a verdict to Brussels just as EU leaders are finishing dinner at the halfway point of their two-day meeting.

If Cameron stays in London for the result, as some British officials expect, he will fly in the following morning, either triumphant -- or defeated and facing the possible end of his own career and opening negotiations on withdrawing from the bloc.

His experience of sitting out the Thursday summit session, where he may delegate his vote to an ally, possibly the Irish or Dutch, would be one that he, or his successor, would have to get used to. Once Britain gives notice it is quitting, it will be excluded from EU discussions on how to handle that process.

Cameron, who is campaigning to stay on the basis of a reform package that he agreed 10 days ago, says he will not delay in notifying Brussels if Britons vote to leave. It is not clear, however, that he could or would do that formally the next day.

“IT’S OVER”

Britain's Prime Minister David Cameron answers questions after delivering a speech on the European Union to workers and guests at the headquarters of O2 in Slough, west of London, Britain, February 23, 2016. REUTERS/Peter Nicholls

Some supporters of a Brexit vote have suggested that formal notification of Britain’s plan to quit could be delayed to give EU leaders time to offer better terms than Cameron’s deal, possibly to a new British premier if Cameron is forced out.

That seems unlikely, however, and EU leaders have insisted there can be no coming back from a ‘Leave’ vote once London has formally started the clock ticking on Article 50 -- ruling out also that Britons could hold a second referendum and change their minds to stay in if they do not like the outcome of talks.

“We negotiated a package to try and save our marriage,” one senior EU official said.

“If Britain votes to go, it’s over. We negotiate divorce.”

Although no member state has voted to leave in the 60 years of the Union and its earlier incarnations, territories such as Algeria have emerged into independence.

But the most recent departure, when Greenland quit the EEC membership it shared with Denmark until 1985, was so tortuous, even though the trade links were tiny, that the 2009 Lisbon Treaty redrawing EU law set the first rules for withdrawal.

“Any Member State may decide to withdraw from the Union,” states the new Article 50. An agreement on terms needs approval by a qualified majority of the remaining member states and the European Parliament. If there were no deal in two years, which veteran trade negotiators think improbable, Britain’s EU membership would lapse unless all 28 states agreed an extension.

Many eurosceptics say an abrupt exit would be no problem and that world trade rules would simply apply. EU states would want to maintain exports into the British market and Britain would be free to cut its own trade deals with others. A variety of models including Norway and Switzerland are available, though most mean trading some independence for access to EU markets.

British law could be reworked, where needed, to cover gaps in lapsing EU rules. And the rights of some 2 million Britons living and working in Europe could be safeguarded reciprocally with those of a similar number of EU citizens in Britain.

The government paper on Monday questioned those assumptions, however. And supporters of EU membership argue that the EU would drive hard bargains, not just to gain economic advantage but to discourage other states from following Britain to the exit.

Fellow leaders face their own challenges from anti-EU opponents -- not least in French and German national elections respectively in spring and autumn next year -- so negotiating a British divorce by mid-2018 may be a messy business.