BRUSSELS -- European Union governments agreed Tuesday to reduce consumption of natural gas this winter to protect themselves against any further supply cuts by Russia amid its invasion of Ukraine, although the measure contains exemptions for some countries.

EU energy ministers approved a draft European law designed to lower demand for gas by 15% from August through March. The legislation entails voluntary national steps to reduce gas consumption, but if that does not yield enough savings, mandatory actions in the 27-member bloc would be triggered.

“I know that the decision was not easy, but I think, at the end, everybody understands that this sacrifice is necessary. We have to, and we will, share the pain,†Czech Industry Minister Jozef Sikela said after chairing the meeting in Brussels.

European Commission President Ursula von der Leyen welcomed the move, saying in a statement that “the EU has taken a decisive step to face down the threat of a full gas disruption†by Russian President Vladimir Putin.

The energy ministers approved the compromise legislation a day after Russian energy corporation Gazprom said it would cut gas flows through the Nord Stream 1 pipeline to Germany to 20% of capacity starting Wednesday. Natural gas prices jumped Tuesday to their highest level since early March, according to Europe's TTF benchmark, and more than five times what they were a year ago.

Since Russia invaded Ukraine in late February and the West moved to punish Moscow by imposing economic sanctions, 12 EU countries have faced halts to, or reductions in, their Russian gas deliveries.

Russia supplied about 40% of Europe's natural gas before the war, but that has dropped to about 15%, sending prices through the roof and straining energy-intensive industries. Companies warn that they often can't switch overnight to other energy sources.

The disruptions in Russian energy trade with the EU already are stoking inflation to record levels in Europe and threatening to trigger a recession just as the bloc was recovering from a pandemic-induced slump.

The energy squeeze also is reviving decades-old political challenges over policy coordination. While the EU has gained centralized authority over monetary, trade, antitrust and farm policies, national sovereignty over energy issues still largely prevails.

Under the ministerial agreement that was sealed in less than a week, the EU's member nations are free to decide how best to meet the target of cutting 15% of their average annual gas use over the last five years.

France, for example, wants to save energy by turning down office thermostats in winter and ensuring that air conditioners in public buildings and shops are used more efficiently.

Exemptions are allowed for countries that might have specific vulnerabilities or find themselves particularly exposed to difficulties from certain cuts. The ministers diluted elements of the original proposal, including exemptions for island countries like Ireland, Cyprus and Malta, which don't have as many energy alternatives.

The European Commission, the EU's executive arm, can ask members to consider triggering a mandatory system of cuts if it still fears a supply shortage in the next eight months. Any five member countries could also trigger a vote if they declare a gas supply alert at the national level.

The energy ministers scrapped a provision in the draft law that would have given the European Commission the power to decide on any move from voluntary to mandatory actions. Instead, the ministers ensured any decision on mandatory steps would remain in the hands of national governments.

The legislation was based on a July 20 proposal from the commission, which is eager to maintain a common EU front over a war that shows no sign of ending. It said coordinated rationing would enable the bloc as a whole to get through the winter should Russia stop all gas deliveries.

Tuesday's deal still marked another milestone in EU policy integration and crisis management. Past EU legislative initiatives in the area of energy often involved months or years of negotiations among national governments.

“We have a blueprint to act together in a coordinated way,†EU Energy Commissioner Kadri Simson said after the agreement was sealed. “This was a test for the unity and resolve of the union.â€

Although the EU has agreed to embargo oil and coal from Russia starting later this year, the bloc has refrained from sanctioning Russian natural gas because Germany, Italy and some other member states rely heavily on imported gas.

“Germany made a strategic error in the past with its great dependency on Russian gas and faith that it would always flow constantly and cheaply,†said German Economy Minister Robert Habeck, who is also responsible for energy and serves as the country's vice chancellor. “But it is not just a German problem.â€

Russia's Gazprom has said the Nord Stream 1 cutbacks were necessitated by delays in receiving a repaired turbine for the pipeline. The turbine, which was repaired in Canada, has not been reinstalled yet, and another is expected to go offline because it needs repairs, Kremlin spokesman Dmitry Peskov said Tuesday.

“The situation has been critically complicated by the restrictions and sanctions imposed on our country,†Peskov added. “If not for those restrictions, all maintenance, warranty, and service operations would have been carried out in a usual, routine, and prompt manner, without causing situations like the one we're seeing now.â€