BERLIN, Sept 19 (Reuters) - The German government is taking steps to counter a surge in Chinese bids for stakes in German technology companies, including the creation of a billion-euro fund that could rescue such firms in financial trouble, a government source told Reuters.

Senior officials are also working on changes to foreign trade regulations to ensure that key technologies remain in German hands. These would include government reviews of foreign acquisitions of stakes in companies below the current 25-percent threshold, and expanding which types of purchases must be examined.

"This is an issue that we are working on very intensely," said the source, who was not authorised to speak publicly.

Berlin was galvanized into action by the surprise takeover of robotics firm Kuka by China's Midea in 2016 and the purchase earlier this year of a 9.7 percent stake in Daimler by Chinese carmaker Geely.

Chinese companies completed 30 acquisitions in Germany last year, nearly double the number for 2016, and Chinese proposals accounted for 40 percent of the 165 reviews of foreign takeover plans in the last three years, the source said.

"China is working diligently to close technology gaps and dominate the world market with new technologies," the source said. Chinese firms, some state-owned, were particularly interested in German companies with special know-how, startups in the area of new technologies, and companies active in critical infrastructure fields, the source added.

As a last resort, the government also wants to set up a fund that could help companies if no private investors could be found to replace a possible Chinese bidder, or if guarantees by the state development bank KfW were not sufficient.

"We are talking about 1 billion euros that would be available as a last resort," the source said, adding that the money could also be used proactively to support development of key technologies by German firms.

Further details were not immediately available about how the instrument would be funded.

A spokeswoman for the economy ministry on Wednesday said the government was not thinking about creating a state-owned fund to defend companies but that it was working on a mechanism to ensure Germany's technological sovereignty.

"We are looking into creating a mechanism with the aim of securing the technological sovereignty of the German industry," she told a regular government news conference.

The German government also signalled its willingness to use a new power to veto foreign takeovers of German companies in the case of a Chinese bid for toolmaker Leifeld, prompting China's Yantai Taihai to drop its bid.

In July, after failing to find a private investor for the firm, the KfW bought a stake in high-voltage grid operator 50Hertz to prevent China's state grid acquiring the shareholding. (Reporting by Andrea Shalal and Thorsten Severin; addiotional reporting by Michelle Martin and Riham Alkousaa Editing by Matthew Mpoke Bigg)