The German utility giant RWE will close its last UK coal plant after the coming winter, leaving only four remaining coal plants powering British homes.

RWE will close the Aberthaw B power station in south Wales at the end of March 2020 after half a century generating electricity from coal.

The energy company, which runs one of the largest portfolios of gas power plants, said it had been clear for some time that the UK was a challenging market for coal generators.

The UK used coal for less than 5% of its electricity last year, and went without coal-generated power altogether for over a week earlier this year, which was the longest coal-free period since the Industrial Revolution.

Coal has been driven out of the electricity system due to rising taxes on carbon emissions, and will be banned by the government from 2025 to help the UK meet its climate targets.

The shutdown of Aberthaw B comes after SSE said in June it would close the Fiddler’s Ferry coal plant near Warrington in Cheshire by the end of March 2020 because it cannot compete with the economics of gas and renewable energy.

EDF Energy said in February that it would shutter the Cottam coal plant in September.

The string of shutdowns means that by next spring just four coal plants will remain in the UK: the West Burton A and Ratcliffe-on-Soar plants in Nottinghamshire, Kilroot in Northern Ireland and two generation units at the Drax site in North Yorkshire, which are earmarked for conversion to burn gas.

Roger Miesen, the chief executive of RWE’s generation business, said: “This is a difficult time for everyone at Aberthaw power station. However, market conditions made this decision necessary.”

He added the company would complete a consultation process with the 170 people directly employed by the plant in the coming months. The Unite trade union called for an urgent meeting with the company to explain why the plant will close earlier than the expected 2021 shutdown.

“The reasons given for the closure are economic – the plant has rarely run over the last few months,” said Kelvin Mawer, a regional officer at Unite. “However, the decision to close has come a lot earlier than expected.”

Tom Glover, RWE’s UK country chair, said: “For nearly 50 years the plant has played an invaluable role in helping to secure the energy supplies across the UK electricity system and we are very proud of its flexibility and resilience.”

The decline of coal in the UK’s energy mix has left space for the growth of renewable energy sources, which generated a third of all electricity used last year.

The government’s official annual energy report revealed that low-carbon electricity – which includes nuclear power and renewables – was used to generate more than half of the electricity used in the UK for the first time last year.

Doug Parr, the chief scientist and policy director at Greenpeace UK, said the shutdown of Aberthaw should encourage more government support for renewables to help meet the UK’s energy needs.

Greenpeace has often criticised the government for blocking onshore windfarms from competing for government subsidies against other energy technologies after the Conservative manifesto ruled out more windfarms for England.

Parr said ministers should “take the brakes off wind and solar power, which will be doing all the heavy lifting in the job of getting the UK to a clean power system”.