The London Stock Exchange has all but ended a planned merger with Deutsche Boerse to create Europe's biggest exchange, which had faced growing opposition since Britain's vote to leave the European Union.

A European antitrust demand that it sell a trading platform in Italy was publicly ruled out by the LSE on Sunday, derailing the 29 billion euro (US$31 billion) bid and knocking shares in both the LSE and Deutsche Boerse on Monday.

The LSE's decision not to sell MTS, which had been demanded in order to beef up smaller French rival Euronext, took the European Commission and Deutsche Boerse by surprise, people familiar with the matter said.

But the failure of the deal had been feared by many involved, amid growing calls from German politicians that the headquarters be shifted from London to Frankfurt because of Brexit - a concession that LSE did not want to make.

Further complicating the picture, German state prosecutors had opened an investigation into Deutsche Boerse Chief Executive Carsten Kengeter, who had been due to head the combined group, for possible insider trading. Kengeter denies any wrongdoing.

"Brexit changed everything," Bill Cash, a British eurosceptic Conservative lawmaker who led a parliamentary debate on the merger last week, said. "It was inconceivable that after Brexit, having left the European Union, that our stock exchange would have been effectively run from Germany."

The breakdown leaves a question mark over the strategy of the exchanges in London, Europe's financial capital, and Frankfurt, the equivalent for Germany, the region's biggest economy.

Earlier this month, Kengeter had warned that Frankfurt stood to lose out if the deal failed. "The biggest risk to Frankfurt ... is doing nothing," he said.

Ingo Speich of Union Investment, a shareholder in Deutsche Boerse, said he was disappointed by the outcome.

"I'm certain that they have a Plan B to hand," he said. "They will have to put something on the table to keep investors on side."

David Moss of F&C Management said he expected "some of the other players initially mentioned as alternative suitors will be running the numbers again".

Shares in Deutsche Boerse tumbled almost five per cent and London Stock Exchange shares were down roughly three per cent.

BREXIT ISOLATION

This is the latest in a series of doomed efforts at dealmaking by stock exchanges, highlighting the perils for any new buyer such as U.S. exchange ICE (ICE.N).

There had already been five attempts, three public and two informal, to combine the London and Frankfurt bourses during the past decade, while the EU blocked a US$17 billion tie-up between what was then NYSE Euronext and Deutsche Boerse in 2012.

The latest attempt came to an end when, in a highly unusual step, the London Stock Exchange pre-empted a European Commission antitrust decision, saying it was unlikely to give clearance for the merger after the London bourse had refused to sell an electronic trading platform in Italy.

A deal would now only be possible if the Commission, which declined to comment, were to change its demands - an outcome that is unlikely given its approach to ruling on other mergers.

While hopes had been high that the plan to create what Kengeter dubbed a financial bridge between continental Europe and Britain, this had been called into question by Brexit.

Britain's departure from the EU may isolate London as Europe's financial center and that had turned the tables in favor of Germany, prompting its politicians to demand Frankfurt not London be the headquarters of the group.

"They don't want to be the first to send a clear signal that Brexit has unavoidable disadvantages for Britain," Thomas Schaefer, the finance minister of the state of Hesse, home to Deutsche Boerse, told Reuters earlier this month.

Such German demands had grated with some lawmakers in Britain. By effectively pulling the plug now, the discussion does not arise.

The question over where the headquarters should be, which would have arisen had EU authorities given the deal a green light, worried LSE executives, two people familiar with the matter said.

But a source close to LSE described the sale of fixed-income trading platform MTS as a key problem because such a move was firmly opposed by Rome.

"MTS has the largest chunk of Italian government bonds which made the Italian authorities wary of a change of ownership."

Deutsche Boerse, however, said that decision not to sell MTS had been made by the LSE, adding that it expected a decision by the Commission by the end of the month.

MTS is a small part of LSE's business. It said it was nonetheless a major platform for trading European government bonds, particularly in Italy.