Valérie Plante is the new mayor of Montreal, the first woman to be elected to the post in the city's 375-year history.

Not only did Ms. Plante win, she did so relatively comfortably, with 51 per cent of the popular vote, versus 46 per cent for incumbent Denis Coderre.

And her left-leaning party, Projet Montréal, won a slim majority of seats on the city's sprawling city council.

Story continues below advertisement

"We have a lot of work ahead in the next four years," Ms. Plante said in her victory speech. "But there's nothing I like more than a challenge."

She reiterated her central campaign promise to be the "mobility mayor" and also made a point of reaching out to the financial community, which openly backed her opponent, saying "Montreal is open for business."

Ms. Plante, 43, a low-profile, one-term city councillor, only became her party's leader in December but, despite being an underdog, never wavered from her belief that the electorate was "thirsty for change."

She ran a solid, mistake-free campaign.

Mr. Coderre, meanwhile, seemed overly confident and he dragged his party down with him. On Sunday night, not exactly humble in defeat, he said his administration had "transformed Montreal forever."

He also announced he would leave municipal politics altogether rather than sit as leader of the opposition at city council.

Mr. Coderre's eponymous party had held 36 of the 65 seats on Montreal city council. That number dropped to 24. Projet Montréal captured 34 seats, up from 19. Seven independents were also elected.

Story continues below advertisement

When the election campaign began, pundits gave Ms. Plante very little chance of winning the mayoralty.

But she proved to be a natural campaigner, ever-smiling and inexhaustible. Her laid-back approach appeared to appeal especially to younger voters.

Mr. Coderre, for his part, was hurt by the fact that he seemed to take re-election for granted until the final days of the campaign, when public-opinion polls showed the two candidates neck and neck.

The campaign revolved principally around transportation issues, not surprising given Montreal's reputation for traffic gridlock, daredevil cyclists and free-spirited pedestrians.

Ms. Plante's Projet Montréal grabbed headlines with a promise to push for a massive expansion of the city's subway system, and a large investment in social housing, even though funding for these projects would have to come largely from the federal and provincial governments.

In a city with a booming economy and a red-hot housing market, Mr. Coderre countered by saying voters were best served by continuity.

Story continues below advertisement

He also warned against the "Plateau-ization" of Montreal. The Plateau, a hip downtown neighbourhood that is Projet Montréal's stronghold, has undertaken numerous so-called traffic-calming and community-building measures such as expanding bike lanes, park beautification and other pedestrian-friendly initiatives that irritate drivers – especially those who drive through the city from the suburbs.

This was perhaps not the best tactic in a city beset by traffic woes because of non-stop road and infrastructure construction.

Ms. Plante's campaign seemed most effective when it zeroed in on the incumbent mayor's penchant for grandiose projects, including a dubious investment in an electric car race and plans to woo a Major League Baseball team back to Montreal. (The Expos left the city in 2004.)

The $24-million Montreal invested to attract Formula E to the city proved particularly contentious, especially that Mr. Coderre declined to say how many tickets to the race were freebies. Late in the campaign, he finally acknowledged that the city gave away 20,000 of the 45,000 tickets "sold" (and sponsors gave away many more.)

The lack of transparency about Formula E focused public attention on Mr. Coderre's perceived arrogance.

He was elected on a platform to fix crumbling infrastructure and rid municipal politics of corruption, and he has largely succeeded. But he did so with what has been described as a bombastic style that is the hallmark of old-style politics.

Story continues below advertisement

Ms. Plante, in debates and on the campaign trail, displayed a very different style and personality, modestly promising to be a leader who engaged in public consultation and promoted co-operation between parties.

But she struggled to flesh out the details of campaign promises, particularly their financial cost.

Projet Montréal did not make much of the fact that Ms. Plante could be the first woman to be elected as mayor of Canada's second-most-populous city, other than a cheeky advertising campaign dubbing her "the best man for the job."

In these days of dirty politics and nasty partisanship, one of the most remarkable aspects of the campaign was the total absence of mudslinging or personal attacks.

Mr. Coderre, a former federal Liberal cabinet minister, was elected mayor in 2013, with only 32 per cent of the vote, defeating now Liberal cabinet minister Mélanie Joly and a host of others.

This time around, however, the mayoralty election was essentially a two-person race, pitting the establishment candidate against a feisty newcomer.

Story continues below advertisement

In defeat, Mr. Coderre became the first mayor of Montreal in 57 years to lose after just one term.

Technically, Ms. Plante is not Montreal's first female mayor, but the first woman to be elected. That's because, in 1976, Lise Payette, a legendary Quebec politician, was named mayor for one day, a symbolic gesture to mark the International Year of the Woman.