COPENHAGEN — Denmark on Friday became the first major oil-producing nation to announce an end to state-approved exploration in the North Sea, with the aim of phasing out all extraction by 2050.

The decision was applauded by some environmental activists, with Greenpeace celebrating it as a “watershed moment,” although other groups had hoped for a faster timeline.

Denmark’s new rules mean companies will be barred from receiving new licenses to search for and extract oil and gas resources. Previously issued licenses will remain valid until 2050.

Denmark is the top oil producer in the European Union, but it has come under mounting pressure as the E.U. aims to become carbon-neutral within the next 30 years.

“It’s a historic decision for Denmark,” Dan Jørgensen, the Danish climate and energy minister, told The Washington Post in an interview Friday.

“It’s a tough decision, it’s an expensive decision, but it’s the right decision,” he said. The move “will cost taxpayer money” but is crucial to stay “trustworthy,” as the country seeks to implement the E.U. climate goal for 2050 by curbing CO2 emissions and offsetting emissions that is absolutely necessary, he added.

Denmark’s decision will translate to an estimated loss of $2.1 billion for a country with a gross domestic product of more than $348 billion last year.

“Denmark is once again showing its willingness to take bold steps to signal its dedication to deep decarbonization and it sends an important signal,” said Sarah Ladislaw, director of the energy security and climate change program at the Center for Strategic and International Studies. “This move will not have an important impact on oil and gas markets, but it will be instructive to see how Denmark continues to reshape its economy as it moves away from the production of oil and gas.”

For Denmark, the announcement marks the final chapter in a five-decade-long era in which oil and gas revenue helped consecutive governments turn the country into one of the world’s richest and most generous welfare states. The country has earned more than $88 billion in total revenue from the North Sea since 1972.

Denmark’s oil and gas output is far exceeded by the production of Norway and Britain, both outside the E.U. In Norway, as in Denmark, oil and gas revenue similarly formed the foundation of the country’s deep-pocketed welfare system. But both nations have seen their production decrease significantly over the last 20 years, making it easier to be at the forefront of the transition to renewable energy.

An E.U. climate law, designed to enshrine the carbon-neutrality goal, could be finalized as early as next week. It is expected to tighten interim goals for greenhouse gas emissions, calling for a 50 to 60 percent reduction from the 1990 baseline, versus the existing 40 percent target.

“This means that the real-life effects of the climate law will commence right away, not at some point in the distant future,” said Pavel Molchanov, energy analyst at the investment advisory firm Raymond James.

European nations, which account for about 10 percent of global greenhouse gas emissions, have already been providing incentives for renewable energy growth but must still shift toward electric vehicles to wean off petroleum use.

Some environmental advocates hope the phasing out of Danish fossil fuel production will create momentum that will be impossible to ignore for larger oil producers.

“Denmark is a small country but has the potential to punch above its weight and pave the way for the necessary transition to green, renewable energy,” Helene Hagel, a policy expert with Greenpeace Denmark, said in a statement.

But some critics suggested that Denmark’s move would have been more meaningful if it had come sooner and been more ambitious in its timeline.

“There probably isn’t that much more oil to extract after 2050,” said Jan Bylov, an oil market analyst at Jyske Bank.

In a tweet, Swedish climate activist Greta Thunberg said: “The real news here is that Denmark will apparently go on extracting fossil fuels for another 3 decades. To us children, this is not the ‘good news’ that some people seem to think.”

Speaking to The Post, Denmark’s energy minister countered the criticism, saying a faster timeline would expose the Danish state to compensation claims from oil companies with the potential to “harm our welfare considerably.”

Amid early signs that Denmark’s oil extraction era could come to an end, French energy producer Total and two other companies recently pulled their applications for new oil exploration projects, preempting the government’s cancellation of the licensing round this week. A small firm, Ardent Oil, was the only company still seeking an exploration license.

Bob Moore, managing director of Ardent Oil, wrote in a statement that the company had spent $2 million without any return, but he said, “We now have certainty about the outcome.”

Outside Europe, New Zealand in 2018 halted the issuance of any further offshore oil exploration permits as part of its effort to make its economy carbon-neutral by 2050.

This week’s decision will not affect more than 50 production platforms in Danish sectors of the North Sea. Nor will the suspension of exploration licenses affect Danish consumers, who can turn elsewhere for oil supplies.

But Denmark’s decision increases pressure on companies and consumers to prepare for the 2050 zero-carbon goal. And other countries in the region may come under pressure to refrain from exploring for new fields in other parts of the North Sea as a result of the Danish move.

But whereas Denmark’s ban will now put it at the forefront of phasing out fossil fuels, Norway as recently as last year announced plans to ramp up oil output.

Denmark’s fossil fuel phaseout does not apply to Greenland, a semiautonomous island that belongs to Denmark, where analysts suspect the existence of large amounts of unexplored oil resources that could become accessible due to climate change in the coming decades. Exploration has increased significantly in that region in recent years, but it remains uncertain whether fossil fuels could be easily extracted there.

In Denmark, the government remains confident that the country’s wealth is not at risk from its transition to renewable energy — a view that is increasingly shared in the country’s oil industry hub, the west coast town of Esbjerg. About 10,000 residents are either directly or indirectly employed by the offshore industry.

Mayor Jesper Frost Rasmussen said residents “feel sad that a large part of our livelihood for the past 48 years now has an end date.” But he said he believes the town’s brightest days may still lie ahead.

Over the next decades, major investments in renewables are expected to turn it into a green-energy center. In 2019, wind power accounted for 47 percent of Denmark’s electricity consumption, and the fastest growth in Danish wind power will be coming from offshore.

“We have transitioned before from being a fishing town to an oil town, and now it’s from oil and gas to wind energy,” Frost Rasmussen said.

Thousands of job losses over the next decades could be offset by tens of thousands of new jobs created in the renewable energy sector, added Greenpeace analyst Hagel.

“The problem will be: How do we find workers?” she said.

Noack reported from Berlin and Mufson from Washington.