MONTREAL - Valerie Plante scored a stunning upset in Montreal's mayoral election on Sunday, defeating incumbent Denis Coderre to become the first woman to win the post.

Coderre said just after 10:30 p.m. that he'd called Plante to congratulate her. He later announced he was leaving municipal politics.

In her victory speech, Plante reiterated her campaign promises, which include improving public transit and lessening road congestion, as well as adding green spaces and social housing.

"During the course of this campaign, I had one goal in mind: I wanted to put Montrealers first and I'm not going to change that," she told a roomful of cheering supporters at a downtown theatre.

"I'm going to put Montrealers first, I'm going to get Montreal moving again, I'm going to build safer roads for pedestrians, seniors and cyclists."

Plante, 43, was leading with over 51 per cent of the vote with almost all polls reporting, compared to just under 46 per cent for Coderre.

She entered municipal politics in 2013 when she won a council seat in a contest that pitted her against former provincial cabinet minister Louise Harel.

In 2016, she was elected leader of the left-leaning party Projet Montreal.

Plante began the mayoral race as a relative unknown but opinion polls showed her steadily gaining on Coderre as the campaign continued.

The mother of two, who cycles or takes public transit to work, sought throughout the campaign to present herself as less flamboyant and more in touch with Montrealers than her opponent.

Her signature campaign promise was a new 29-stop subway line that would link the city's densely populated northeast to downtown.

During her victory speech, she appealed to the provincial and federal governments to partner with her on her two biggest campaign promises: the subway line and increasing social housing in the city.

"In Quebec and Ottawa, I invite you to act on the strong message that Montrealers are sending you," she said.

"I know we can't do it tomorrow, but we can start working together, immediately, for those who need it most."

Prime Minister Justin Trudeau saluted Plante's historic victory in a tweet late Sunday night.

"Congratulations ↕Val-Plante, first-ever woman elected mayor of Montreal! I'm looking forward to working together on our shared priorities," he wrote.

The outgoing Coderre, a former Liberal MP and cabinet minister who was elected mayor in 2013, had campaigned largely on his record.

He had highlighted his ambitious infrastructure renewal plan, naming an inspector general to oversee the awarding of city contracts, and negotiating increased powers for the city from the province.

But while Montreal's economy has boomed during his mandate, Coderre was often branded by opponents as an arrogant leader who makes hasty decisions with little consultation.

He was criticized for spending millions on showy projects to celebrate the city's 375th birthday, and drew the ire of dog lovers when he introduced legislation last year to ban pit bulls from the city.

In his concession speech, Coderre announced he would be leaving municipal politics but said he remained proud of what he'd accomplished.

"I'm leaving with my head high," he said. "Montreal is an exceptional city, Montreal is a metropolis that is the envy of the world."

Incumbents fared better elsewhere in the province, including in Quebec City where Mayor Regis Labeaume easily won a fourth term.

Marc Demers was re-elected in Laval, as was Yves Levesque in Trois-Rivieres and Maxime Pedneaud-Jobin in Gatineau.

There was a surprise in Sherbrooke, however, where incumbent Bernard Sevigny lost the mayoral race to independent candidate Steve Lussier.

Some 858 municipal elections were held across the province, with over 8,000 mayor or councillor jobs up for grabs.

Of those, about half were already filled by election day by candidates who ran unopposed.