FRANKFURT/BERLIN (Reuters) - Germany is nearing a deal to invest in 50Hertz to fend off China's State Grid as an auction for a 20 percent stake in the German high-voltage energy network operator draws to a close, people close to the matter said.

State Grid last week made a final offer worth just below 1 billion euros (924.35 million) for a 20 percent stake in the company that Australian infrastructure fund IFM had put on the block, they said.

While no other suitor participated in the final round of bidding, German state bank KfW is still poised to pocket the stake due to the right of first refusal held by Belgian majority shareholder Elia <ELI.BR>, they said.

Highly indebted Elia is expected to draw the right by a July 28 deadline and then sell the stake on to KfW, they added. "The deal is as good as done," one of the people said.

Germany's economy ministry declined to comment, while State Grid and Elia were not immediately available for comment.

A final decision is expected to be taken at Elia's end-July board meeting, the people said.

"Germany views 50Hertz as part of its crucial infrastructure and has asked Chinese officials to understand this," another source said, referring to high-level China-Germany meetings earlier this month.

German Economy Minister Peter Altmaier, however, had said in June that he saw a problem in letting critical infrastructure fall into the hands of investors whose motivation and background were not clear, citing 50Hertz as an example.

In March, Elia exercised its right to buy a first 20 percent stake in the network operator for 976 million euros ($1.13 billion), beating State Grid, which had already negotiated the planned purchase.

Sources familiar with the situation said Elia lacked the financial firepower for a second large transaction. They added that KfW was likely eventually to hand the investment on to an investor deemed suitable.

German politicians have viewed State Grid's interest in 50Hertz critically, amid fears that China was taking control of key technologies while protecting its own companies against foreign takeovers.

IFM and Elia bought 50Hertz from Swedish utility Vattenfall [VATN.UL] in 2010 for 810 million euros, meaning IFM was able to sell a 20 percent stake at six times the amount it paid.

50Hertz operates a grid of some 10,000 km in northern and eastern Germany, supplying about 18 million people with electricity.