German companies are scaling back their investment in Britain ahead of its June 23 referendum on membership of the European Union, and German industry is becoming increasingly vocal in warning that a Brexit would hit both countries' economies. German foreign direct investment to Britain fell by 6 percent on the quarter to 4.4 billion euros ($5 billion) in the first three months of this year, Bundesbank data reviewed by Reuters showed. That followed an already steep annual decline of more than 40 percent in 2015. "A British exit means uncertainty for German companies doing business in Britain," Markus Kerber, managing director of the BDI Federation of German Industries, told Reuters. "Firms are reacting to this, they are delaying or reducing their investment." Reflecting the concerns of German companies and investors ahead of the British referendum, Kerber said a Brexit would lead to severe legal uncertainties for at least the next two years, creating economic risks for both Britain and Germany. German companies are among the biggest foreign investors in the UK, with 2,500 subsidiaries and some 500,000 British employees in sectors such as financial services, manufacturing, transport, energy and retail, according to German Industry UK, a private organization of some 100 chief executives of companies in Britain with a German majority shareholding. While German firms generally decline to comment in detail on their investment plans in Britain, there are signs that managers are becoming increasingly worried ahead of Britain's referendum. "From our point of view, it would be advantageous, particularly in terms of wealth and employment if Britain was to stay in the EU," a Siemens spokesman said. He said if Britain should leave the EU, Siemens would not terminate its business activities there. "But a British exit could play a role when it comes to future investment decisions." Like many other German companies in Britain, Siemens sent a letter to its 14,000 British employees last month, warning of the risks the firm would face if Britain voted to leave. "In particular, a new trade deal with the EU could take many years to conclude and it is impossible to predict the terms that will be agreed and at what price," the Siemens management said. "This uncertainty, and threat of increased costs, could make the UK a less attractive place to do business and may become a factor when Siemens is considering future investment here." Companies that have published similar letters or statements include BMW, whose British employees make the luxury Rolls-Royce car, as well as chemical company BASF and planemaker Airbus . A Brexit would not only affect the British economy. A study by DZ Bank showed it could also cost Germany up to 45 billion euros by the end of 2017 as exports from Europe's economic power house would likely be hit, at a time of already waning demand from emerging markets like China. In 2015, German companies exported goods worth some 89 billion euros to Britain, making the UK their third-most important export destination. At the same time, Germany imported British goods worth some 38 billion euros, leaving a trade surplus of around 51 billion euros. With a total trade volume of 127.5 billion euros, Britain is Germany's fifth-biggest trading partner behind the United States, France, the Netherlands and China. For the UK, Germany is the most important trade partner, ahead of the United States.