Solar power in the UK produced more electricity than coal across the whole of May, the first ever month to pass the milestone, according to research by analysts at Carbon Brief. Solar panels generated 50% more electricity than the fossil fuel across the month, as days lengthened and coal use fell. Solar generated an estimated 1,336 gigawatt hours (GWh) of electricity in May, compared to 893GWh output from coal.

Coal was once the mainstay of the nation’s power system but the rapid rise of solar panels and of climate change concerns has seen its use plummet, leading to a series of milestones in recent weeks.

Solar surpassed coal over a whole day for the first time on 9 April, while the electricity produced by coal fell to zero several times in early May, thought to be the first time this had happened since the late 19th century.

Coal power stations are running less often due to age and restrictions on the pollution they produce and a series have closed down in recent months, including Ferrybridge and Eggborough in Yorkshire, Fiddlers Ferry plant in Cheshire and Longannet in Scotland.

The government has pledged to phase out all coal-fired electricity by 2025, but on Tuesday a Conservative thinktank called for the shutdown to come at least two years earlier.

Former Tory energy minister Lord Greg Barker said: “The government should give investors [building greener energy projects] even greater certainty and with that, put UK plc firmly at the forefront of the global drive for clean and smart energy technologies.”

The cost of renewable energy, particularly solar panels, has plummeted in recent years. However, the government has cut solar power subsidies and blocked onshore wind farms, while backing fracking and new nuclear power stations.

Earlier in May, a report from Ernst & Young found the attractions of the UK to investors in renewable energy projects was at an all-time low. The UK had routinely topped the annual league table in the mid-2000s but slid to 13th in the global rankings in 2016. EY’s Ben Warren, said the UK government’s policies were “putting the attractiveness of the UK’s renewable energy sector on a landslide. The current approach is going against the grain of almost universal global support for renewables.”

Renewable energy records are also being set in other countries, with Portugal running for four days straight on green energy alone in early May. In 2015, 42% of all Denmark’s electricity was produced by wind turbines.

Investment in renewable energy around the world now far outstrips that in coal and gas plants. In 2015, $286bn (£196bn) was invested in renewable energy, more than double that invested in fossil fuel power stations.