A 38-year-old academic named Naheed Nenshi was elected the mayor of Calgary Monday night in a nail-biter of a three-way race that included a longtime alderman and a former CTV news anchor.

Nenshi also made history, becoming the first visible minority to become mayor of Calgary and the first Muslim to hold the top political office in a major Canadian city.

Nenshi was locked in a tight contest with veteran alderman Ric McIver and former CTV Calgary news anchor Barb Higgins. 

Higgins started strongly out of the gate when the polls closed at 8 p.m. local time, but McIver caught up and the two were running neck-and-neck. But with half the polls reporting, Nenshi seemed to come out of nowhere and overtook them both. In the early hours of Tuesday morning, McIver was trailing Nenshi in second place and Higgins was in third.

Nenshi, who used Twitter and social media effectively during his campaign, had hundreds of supporters who stood out at rallies in their "Purple Revolution" T-shirts, and who touted the candidate's fight against what he called a rudderless, misspending city council.

Neshi describes himself as a passionate Calgarian. He's the son of immigrants from Tanzania. He was born in Toronto but his family moved to Calgary when he was young. Educated at Harvard, Nenshi worked for many years as a business consultant before becoming a professor at Mount Royal University.

McIver was initially expected to walk away with the election, but recent political fireworks allowed his rivals to claw their way back into the race. Still, McIver says that he campaigned like mad over the past weeks, shaking an estimated 100,000 hands in the process.

"It's been a wild ride and it's been great. I absolutely love the city and I've gone to the four corners to meet people," McIver told CTV Calgary.

Meanwhile, Higgins gained ground earlier this week after a scrappy live television interview in which she defended her political intentions and her campaign team.

During the TV spot, the interviewer accused Higgins of being a puppet candidate, but she hit back and accused the interviewer of journalistic bias. While Higgins has gained many new supporters over the past week, neither of the city's two major newspapers endorsed her candidacy.

"You know, the endorsement that matters comes tomorrow. I have been meeting a lot of groups over the last month, (and) when I walk down the street, people are really positive," she told CTV Calgary.

Mandel a clear favourite

In Edmonton, incumbent Stephen Mandel had little difficulty winning his third term.

"This is how democracy works," he said to a cheering crowd Monday night. "Tonight marks the culmination of tremendous amount of work and tremendous amount of people."

While Mandel was seen as a clear favourite, he wasn't counting on an easy victory.

A boisterous public debate was raging in the city over a public-private proposal to build a new hockey arena in the city's downtown for the beloved Edmonton Oilers. And the campaign took a nasty turn when Mandel became the target of attack, mostly centered on the City Centre Airport closure.

Mandel wanted the airstrip closed and hopes to have the land re-developed. Some of his opponents accused Mandel and members of council of being undemocratic following the city's decision to not hold a plebiscite on the issue. 

Six other candidates had their names next to Mandel on the ballot, including Daryl Bonar, David Dorward, Daniel Dromarsky, Andrew Linekar, Bob Ligertwood and Dave Dowling. Mandel took about 54 per cent of the vote followed by Dorward who took 29.7 per cent of the vote. Bonar came in third place with just 12 per cent of the vote.

Following the results announcement, Dorward addressed his volunteers and supporters.

"I ask all my supporters who voted for me to support this mayor and council. We must move forward with respect and dignity," said Dorward.

Races in other cities, such as the southern community of Lethbridge, were also tight. Two-term alderman Rajko Dodic narrolwy defeated past consumer advocate Chris Spearman by just 208 votes to become that city's new mayor. With a population of 85,000, Lethbridge had no incumbent candidate and more than two dozen people were seeking a spot on city council.

The outcome of the votes can be seen as a gauge of the province's overall mood: Do voters crave change or do they want stability? The result could impact both the federal and provincial level.

Provincially, the Progressive Conservatives have held power for four decades, but cracks are beginning to show in their armour, with Premier Ed Stelmach facing weak approval ratings.

Recently, three MLAs have defected to the Wildrose Alliance Party, and their leader Danielle Smith has attracted media attention across the country for tapping into public angst over the province's political and economic direction.

In particular, Smith has charged that Stelmach is too feeble to defend the province's oil sands against mounting environmental criticism.