The London Stock Exchange and Germany's Deutsche Boerse say they are merging in an all-stock deal that will leave the German side with a majority in a company worth about $30 billion.

Ian Stuart from HSBC Talks at London Stock Exchange on June 24, 2015 in London, England. (Photo by Bethany Clarke/Getty Images for International Festival for Business)

The exchange operators are calling it a merger of equals that will accelerate their growth and offer customers more products and services -- and said the deal is going ahead even if Britain votes to leave the European Union.

They expect to complete the combination by the first quarter of 2017. The two companies together are worth about $30 billion based on their stock market value Wednesday.

The deal makes sense even if British voters decide to leave the European Union in a referendum June 23, the two sides said, but conceded there are risks to its business from a potential British exit.

It said the tie-up would benefit from European Union efforts to create a single capital market and expand the cross-border use of stock and bond markets to finance companies, a project known as capital markets union. They said that a vote to leave would put the capital markets union project at risk.

The companies "believe that the merger is well positioned to serve global customers irrespective of the outcome of the vote" although the outcome "might well affect the volume or nature of the business carried out by the combined group."

The owner of the New York Stock Exchange said March 1 that it was considering a competing bid for the London exchange. Officials at Intercontintal Exchange Inc., which owns the NYSE, could not immediately be reached.

In the merger deal, a U.K.-based holding company will be set up to acquire the London Stock Exchange Group PLC and Frankfurt-based Deutsche Boerse AG. When the deal is done, Deutsche Boerse shareholders will hold 54.4 percent of the holding company and Deutsche Bank CEO Karsten Kengeter will be chief executive.

Both companies will name an equal number of board directors; LSE chairman Donald Brydon will serve as board chair.

The company would have headquarters in both London and Frankfurt. The deal needs approval from regulators in the European Union, the U.S. and Russia.

The London Stock Exchange said Russian approval was needed because it owns Exactpro, a firm with offices in Russia specializing in quality assurance for exchanges and financial organizations.

(© 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed)