Over the past five years, the leaders of the European Union tried to turn the 27-country bloc into a global climate front-runner.

They made big strides. They enshrined into law an ambitious target to cut planet-heating emissions by more than half by 2030. They set a 2035 deadline on the sales of new gas-guzzling cars. They expanded the price that industries must pay for emitting greenhouse gases.

But this week, as voters prepare to go to the polls, Europe’s green credentials face a very different test.

There’s widespread frustration over rising prices. Farmers’ groups have stormed European capitals to protest proposals to limit pollution from agriculture. The right wing is ascendant. The Greens, who in 2019 won their largest share of seats in European parliamentary elections, are today polling poorly.

If Europe loses its green groove in the coming elections, it could have far-reaching consequences not only for European citizens and businesses, but also the rest of the world. Europe is among history’s top polluters.

“There is a lot at stake,” Laurence Tubiana, one of the key architects of the Paris climate accord and now the head of the European Climate Foundation, wrote in an email. “The gains of the last five years cannot be taken for granted.”