Socialist frontrunner Emmanuel Grégoire was elected Paris mayor on Sunday, beating right-wing former minister Rachida Dati in the last major test of the French public mood ahead of next year’s all-important presidential election.

Grégoire, a 48-year-old former deputy of outgoing Mayor Anne Hidalgo, was credited with around 51% of the vote, trouncing Dati and hard-left rival Sophia Chikirou – and defying forecasts of a close race.

“Paris has decided to stay true to its history,” Grégoire told a cheering crowd, vowing to resist the right and far right in the lead-up to next year’s presidential polls. 

“Paris will be the heart of the resistance against this alliance of the right, which seeks to take away what we hold most precious and fragile: the simple joy of living together,” he added. 

The newly elected mayor then cycled to City Hall on a Velib’, the French capital’s flagship bike-sharing system, signalling continuity with his predecessors. 

His victory follows 25 years of transformational rule under successive left-wing mayors Bertrand Delanoë and Hidalgo, who have turned the polluted metropolis into a tree-lined city of bike lanes and pedestrian streets.