Paris has elected a 54-year-old Spanish-born socialist politician as the city's first female mayor.

Anne Hidalgo, the deputy of outgoing mayor Bertrand Delanoe, beat her centre right rival Nathalie Kosciusko-Morizet, in the all-women race for the French capital with 54.5% of second round votes.

"I am the first woman mayor of Paris. I am aware of the challenge," Hidalgo said in a victory speech.

The daughter of working-class parents, Hidalgo was born Ana in 1959 in the southern Spanish town of San Fernando, near Cadiz.

Her family moved to Lyon two years later and Ana changed her name to its Francophone equivalent of Anne upon becoming a French national at the age of 14.

She first arrived in the French capital in 1984, starting her career in the public administration as work inspector.

Hidalgo later became an adviser to former Labour minister Martine Aubry, and moved on to become Delanoe's most trusted aid has he took over the reins of Paris in 2001.

Hidalgo has three children from two marriages, the second with a fellow Socialist politician, Jean-Marc Germain MP, who was Aubry's cabinet director.

Described by colleagues as modest, discrete and hardworking she is said to be capable of showing who the boss is when needed.

"When she wants something she can hit the ceiling," a socialist MP told 20minute newspaper.

Her victory saved President Francois Hollande's party from a total debacle at the municipal elections.

The socialists lost control of more than 150 towns of more than 9,000 inhabitants to the centre-right UMP party and the far-right Front National (FN) party.

Hidalgo told Europe 1 that Hollande congratulated her, saying her election was "the only good news amid an ocean of bad news."