Former New Democrat MP Kennedy Stewart has won a neck-and-neck mayoral race to lead Vancouver, as local government saw shakeups across the region.

Supporters chanted, "Kennedy, Kennedy," and broke out in dance as results came in early Sunday morning, heralding Stewart in as the first Independent mayor of Vancouver in more than 30 years.

He scraped ahead of Non-Partisan Association candidate Ken Sim with 984 votes.

"They voted for a plan that is bold but achievable," Stewart told the crowd, adding he will begin immediately to deliver on campaign promises like increasing the housing supply and creating a Downtown Eastside task force with a focus on stemming the opioid crisis.

Sim said he would not concede early Sunday morning.

"As you know this has been a very unprecedented election. We've consulted with our advisers and our team, they mention there are still ballots to be counted. Barring that, let's speak to the results we have tonight," he said, congratulating Stewart.

Stewart's election ends Vision Vancouver's 10 year rule under outgoing mayor Gregor Robertson, who didn't seek re-election and leaves the city with a housing crisis that became the focus of the campaign.

The election of @KennedyStewart ends Vision Vancouver's 10 year rule under outgoing mayor Gregor Robertson, who didn't seek re-election and leaves the city with a housing crisis that became the focus of the campaign. #vanelxn18 #vanpoli

It was one of several significant turnovers in Metro Vancouver that also saw a comeback for former mayor Doug McCallum in Surrey and former firefighter Mike Hurley defeat five-term mayoral institution Derek Corrigan in Burnaby.

In Nanaimo, New Democrat legislator Leonard Krog's win put the minority provincial government's hold on power into question as his departure will trigger a byelection.

It won't be enough to tip the balance of power to the Liberals' favour against an NDP minority government that's propped up by the Greens, but it would bring it to the brink.

The Liberals have 42 seats in the house, the New Democrats 41, including Krog, the Greens have three seats and there is one Independent.

Victoria Mayor Lisa Helps won a second term despite facing nine challengers and some controversies during the campaign, including her government's decision to remove a sculpture of John A. Macdonald from the entrance to city hall.

The campaign in Vancouver was marked by a crowded race of new candidates and parties with converging platforms focused on increasing housing supply in the face of the city's affordability crisis.

Stewart will lead 10 other councillors divided across party lines, including five NPA councillors and five from progressive parties.

"I've been talking with them all the way through, all the way through this race and I think there are ideas we share in common and we're just going to have to go policy by policy and make sure we're not alienating anyone. I'm confident we can do it," Stewart told reporters following his victory speech.

Eight women also make up the majority.

The city is somewhat unusual in Canada because it operates under a party system.

Since 2008, centre-left Vision Vancouver has dominated council under Robertson but the party didn't run a mayoral candidate this election.

The centre-right NPA had a long-running grip on power before that, with some notable exceptions, including 2002 when the Coalition of Progressive Electors won the mayor's office and eight of 10 council seats.

Vancouver's last independent mayor was Mike Harcourt, who served from 1980 to 1986, before going on to become premier.

Voters in some cities reported longer waits than they'd experienced in previous elections.

In Vancouver, the ballot was almost 13 centimetres longer than usual because of the 158 candidates on the list, the city said in a tweet. That meant it took about 22 seconds to cast each ballot through an electronic reader, and longer if the ballot was rejected.

"Seems like we're stuck in the 1990s for how slow it reads it," Paul Schellenberg said after voting at St. Andrew's-Wesley United Church in downtown Vancouver.

He said collecting and filling out the ballot was "very fast," but a long line formed as voters waited for their ballots to be electronically processed.

Brian Thorn said the randomized order of the candidates made it harder to find the ones he'd chosen to vote for, which also added to the time delay.

The City of Burnaby added an extra voting tabulator to its Gilmore station Saturday afternoon to ease the line, while the City of Victoria thanked voters for their patience in a tweet.

Correction October 22, 2018: a previous version of this article said seven women were elected to City Council. The number has been corrected to eight.