Kenyan judges have halted plans to construct the country's first ever coal-powered plant near the coastal town of Lamu, a Unesco World Heritage Site.
The National Environmental Tribunal ruled that authorities had failed to do a thorough environmental assessment.
Critics say the plant would have dire economic and health effects on locals.
The Chinese-backed power station would increase the country's greenhouse gas emissions by 700%, activists say.
They warn that construction of the 1,050 MW coal-fired plant near Lamu - a 14th Century idyllic tourist spot - would put its protected status at risk and ruin livelihoods of the locals.
Wednesday's ruling found that the National Environment Management Authority (Nema) had breached the law for approving the construction of the plant without a proper environmental impact assessment.
Campaign group deCOALonize had taken Nema to court, saying it had not taken note of the adverse effects the project would have on farmlands and the local fishing industry.
"We welcome this decision because it shows that communities cannot be taken for granted," Omar Elmawi, DeCOALize campaign coordinator, told the BBC.
The tribunal also found that Nema had failed to inform the public about the likely health effects of the effluence emitted from the plant which, it said, could trigger breathing difficulties, premature deaths and acid rain that could poison the soil and kill fish.
You may also be interested in:
Locals were also not informed about the size of the land acquired for the $2bn (£1.5bn) power station to be built by Chinese contractors, the ruling said.
The five-member tribunal ordered that a new environmental impact assessment should be undertaken to ensure proper public participation.
Those defending the plan were given 30 days to appeal against the ruling.
If the project goes ahead, Kenya will have to import the coal, which goes against its ambition to use clean energy.
At least two-thirds of Kenya's electricity is currently generated by renewable resources and it has pledged to reduce its small carbon footprint by nearly a third over the next decade.
China has also made a commitment to reduce its reliance on coal, but at least a quarter of the hundreds of coal-fired power stations being built or planned to be built around the world are being financed by China.
Critics say that by building these plants China is outsourcing its fossil fuel use by providing a market for its coal and encouraging its use in other countries.
What are Kenya's main energy sources?
- Hydroelectric: 36%
- Geothermal: 29.1%
- Diesel: 31.2%
- Gasoil: 2.4%
- Wind: 1.1%
- Cogeneration: 0.1%
- Coal: 0%
- Solar: 0%
- Import: 0%
- Generic Backup Capacity: 0%
Source: Kenya Energy Regulatory Commission, 2018