* Government could present proposals to parliament this week

* Government may acquire stake in Uniper: sources

* Possible Uniper bailout could follow Lufthansa rescue model

* Germany fears ‘Lehman moment’ for energy firms

BERLIN, July 4 (Reuters) - Germany's government will have the power to take stakes in utilities and impose emergency levies on consumers under proposed legal changes now under discussion, three sources told Reuters, as Berlin moves to beef up energy security.

Ministers are scrambling to deal with the impact of soaring energy prices on electricity firms after Russia's invasion of Ukraine, with Economy Minister Robert Habeck recently warning of "a Lehman effect" as suppliers face soaring costs to meet obligations to customers.

Officials have been talking to Uniper, the largest buyer of Russian gas in Germany, about a bailout, and the sources said Berlin wants to ensure similar rescue measures are available for other companies if required.

Uniper said last week it was discussing possible guarantees, raising credit facilities or even the state taking an equity stake.

The sources told Reuters the government might take a stake in Uniper as a last resort, and was preparing possible rescue measures of similar companies through amendments to its energy security law. Uniper declined immediate comment.

Amendments to the law are currently being discussed among government ministries and could be presented to parliament on Friday.

They may also allow the government to quickly impose a special levy on consumers as a means of passing on soaring energy costs equitably, the government sources said.

A possible bailout for Uniper could be modeled after pandemic relief for airline Lufthansa, which was saved from bankruptcy during the coronavirus pandemic with a 9 billion euro ($9.40 billion) aid package, one German government source said.

"The federal government should be given options along the lines of the Lufthansa aid," the source said.

Lufthansa's bailout saw the state taking a 20% stake in the airline through an Economic Stabilization Fund, but without being able to exercise shareholder voting rights.

The airline was not allowed to take over other companies until 75% of the state aid had been repaid, and its shareholders and managers could not benefit from taxpayers' money, meaning dividends and bonus payments were put on hold.

SKY-HIGH PRICES

Decades after de-regulating their energy markets, governments across Europe are intervening to prop up utility companies buckling under sky-high prices, while also protecting consumers from soaring costs.

Several European energy suppliers have gone bust over the past year, where they have had long-term contracts with customers and have been unable to pass on the swift spike in prices.

To try to shield consumers from soaring energy bills, governments have also turned to windfall taxes on oil and gas companies, subsidies and discounts.

Russia is Germany's top supplier of gas, making it more exposed than other European states to an economic war with Moscow.

Soaring prices have heaped political pressure on Chancellor Olaf Scholz, who on Monday will meet unions and employers to try to build a consensus on fighting inflation, reviving a concept established in 1967 in response to economic recession that ended the country's post-war boom.

Germany has accused Russia of strangling the flow of energy to Europe through spurious pretexts in revenge for sanctions over the Ukraine war, and is closely watching whether flows will resume after scheduled maintenance July 11-21.

Russia has denied doing so, and said it was a reliable energy supplier that honours its contracts. Uniper said it was receiving around 40% of the normal amount of gas from Russia at the moment.

The benchmark Dutch front-month gas price rose more than 8% on Monday to a peak of 160 euros per megawatt hour, its highest level since March 9. The price remains below a record but is still 500% higher than this time last year.

Germany's government has warned of possible energy shortages and rationing in the winter months if it cannot fill its gas storage quickly enough.

"The hope of filling the gas storage facilities to some extent by winter could be torpedoed by Russia at any time. Then there are hardly any compensatory possibilities left," said a note from Sentix that tracks investor morale in the euro zone.

"In Germany, some ideological boundaries have to be crossed to prevent a "Lehman moment" in the energy sector," it said, referencing the U.S. bank whose demise help triggered the 2008 financial crisis.

($1 = 0.9573 euros) (Reporting by Markus Wacket; Additional reporting by Susanna Twidale and Paul Carrel; Writing by Matthias Williams; Editing by Kirsti Knolle and Jan Harvey)