In 2018, when the power company Hope Energy entered Japan’s new retail electricity market, it thought it had a surefire strategy. Wholesale energy was becoming ever cheaper as liquefied natural gas flooded global markets. Hope Energy would sell competitively priced electricity contracts to local governments and public facilities, undercutting Japan’s old-line power companies, which had long prioritized stable supplies over cost.

But then came the pandemic and the Ukraine war, which caused L.N.G. prices to soar. Hope Energy could not honor its price pledges, and it, along with more than 30 other electricity retailers in Japan, went out of business. Customers scrambled for new providers.

Now, the world’s third-largest economy is again confronting the fragility of its energy system. That has forced a reconsideration of how the resource-poor country can maintain a reliable and affordable power supply in an era of growing geopolitical uncertainty, reflected most immediately in rising calls for a boycott on Russian energy.

The reassessment, analysts agree, is likely to set back Japan’s efforts to more fully deregulate its electricity industry and reach its goal of carbon neutrality by 2050. It is also putting new pressure on the country’s economy and politics, as anxieties about Japan’s ability to supply itself with power rise to their highest levels in over a decade

While many nations have been buffeted by the energy-market chaos set off by Russia’s invasion of Ukraine, prompting a rush for new sources of energy and causing pain for consumers, the spike in L.N.G. prices has become a particular source of concern for Japan.

Energy security has been a longstanding preoccupation in Japan, where electricity generation is overwhelmingly dependent on imported fossil fuels. Natural gas has become an increasingly important part of the mix, as the country sought to shut down polluting coal-fired plants and mothballed much of its nuclear power industry after the 2011 meltdown at the Fukushima Daiichi station.

Cheap and plentiful, cleaner than coal and safer than nuclear: L.N.G. was seen in Japan as a crucial transitional fuel as it gradually shifted to renewable energy. But it’s no longer cheap or plentiful, with supplies diminished by logistics issues related to the pandemic and increased demand from China as it moves away from coal. Sanctions on Russia, one of the world’s biggest suppliers of L.N.G., have further crimped supplies, sending prices soaring.

In March, L.N.G. sold in Japan for nearly 23 percent more than it did the previous month, a problem made worse as the yen has sunk to 20-year lows against the dollar.

“The war, the sanctions, are a very real stress test” to Japan’s energy system, said Yuriy Humber, the founder of Japan NRG, a consulting group. So far, he added, the results are “not looking good.”

last year. Even before the Fukushima disaster, L.N.G. generated around 24 percent of the country’s electricity, a share that had grown as the country took coal power offline.

After the meltdown, usage skyrocketed, and today over one-third of Japan’s power comes from the fuel. In 2020, Japan purchased more than 74 million tons of L.N.G., over one-fifth of the global supply. (In the United States, 38 percent of electricity comes from natural gas, but the country produces most of what it consumes.

Around 8 percent of Japan’s supply comes from a project, Sakhalin-2, that was established as a joint venture among the Russian firm Gazprom, the British company Shell and two Japanese companies, Mitsui and Mitsubishi. That has put Japan in a difficult position as the United States and others have called for a boycott on energy exports from Russia, a critical source of Japanese L.N.G.

In early April, Japan announced that it would eventually phase out purchases of Russian coal. But Prime Minister Fumio Kishida has insisted that his country cannot afford to cut off its support to Sakhalin-2, which he has described as “extremely important to Japan’s energy security.”

Even without the war and the pandemic, an energy crisis seemed bound to happen in Japan.

Some regions have run their electrical grids near capacity since the Fukushima disaster. In the warmest and coldest months, regional providers’ surplus power generation often dips below 3 percent, the minimum level considered necessary for guaranteeing a steady supply. And L.N.G., unlike other energy sources, is not amenable to stockpiling. Japan maintains only two to three weeks’ supply at a time, and that has left the country vulnerable to blackouts in periods of unexpectedly high power demand.

But the collapse of Hope Energy and other electricity retailers is symbolic of how much the two calamities have shifted the once optimistic calculations around Japan’s energy future.