The European Union’s top antitrust enforcer on Thursday threatened to formally charge the Russian natural gas giant Gazprom with restricting trade and price gouging, raising the stakes in a two-year investigation that has already created tensions with Russia’s president, Vladimir V. Putin.

An antitrust action would be risky, given Europe’s dependence on Gazprom for about a quarter of all natural gas consumed in the European Union, and given the Russian company’s history of cutting off customers for perceived political affronts. Gazprom, for instance, stopped providing fuel to Ukraine in midwinter “gas wars” in 2006 and 2009.

“We suspect that Gazprom has been hindering the free flow of gas across member states and the diversification of sources of supply” and “has imposed unfair prices on its customers,” said Joaquín Almunia, the European Union competition commissioner. “It would be premature to anticipate when the next steps might be taken, but we have now moved to the phase of preparing a statement of objections.”

Gazprom said it would not comment on the case, and a Russian government representative also declined to comment on Thursday.