In 2012, the UK ranked 20th out of a list of 33 rich countries in terms of low-carbon electricity use. In 2017, it jumped to 7th. No other country has ever climbed up the rankings so quickly, according to a study by Imperial College London.

How did the UK manage it? It imposed a carbon tax.

The carbon tax, or the carbon floor price as policymakers refer to it, was introduced in 2013. It stands at £18 ($25) per ton of carbon dioxide emitted in producing electricity. As a member of the EU’s emissions trading scheme (for now), UK electricity providers also pay a market-based price for carbon credits, which is about £5 per ton of CO2.

After the tax was introduced, it became much more expensive to burn coal, which produces about twice the emissions per unit of energy as natural gas. The upshot:

When it was first devised, the idea was to gradually raise the carbon floor price. Despite lobbying for long-term clarity on how the tax will work, for now the government has committed only to freezing the charge until 2020.

The carbon tax has hit fossil-fuel power generation. Take Britain’s latest electricity-market auction, as Quartz has explained:

The country consumes more electricity during winters than it does in summers, so it needs to ensure that there is enough extra capacity to meet the extra demand at peak times. The government finds the necessary capacity via annual auctions, where power companies that use coal, natural gas, or nuclear power can bid a price to fulfill that demand ahead of time.

Until 2017, the only participants in the bidding process were power generators in the UK. However, from this year onwards, the UK is allowing bids from interconnectors, which are companies that connect the UK’s grid to France and the Netherlands, with plans for links to Norway and Belgium within the next few years.

The carbon floor price only applies at the point of generation. That means, only UK producers are required to pay it. In normal conditions, this would mean that the interconnectors would have been able to include bids from cheaper dirty fossil fuel generation outside the UK. As it happens, however, France, Norway, and Belgium generate a very high proportion of electricity from low-carbon sources. Even the Netherlands, which only gets 15% of its electricity from renewable sources, can provide a lot of low-carbon electricity on windier days.

So even though the UK hasn’t increased its carbon floor price, the country’s domestic fossil-fuel power companies are suffering. This is one reason why the UK energy ministry now expects only 6 GW of new gas-fired power plants to come online by 2035, compared with a previous projection of 14 GW.

With the carbon floor price probably set to increase after 2020, the clear direction the UK’s electricity market is headed is away from fossil fuels.