VICTORIA -- B.C. New Democrat Adam Walker has won a seat in the legislature, defeating Liberal incumbent Michelle Stilwell in the Parksville-Qualicum riding.

The riding was one of several across the province that were too close to call in the immediate aftermath of the Oct. 24 election.

The final ballot count concluded Sunday, leaving the New Democrats with 57 of the 87 seats in the legislature.

The B.C. Liberals won 28 seats, one of which is pending a judicial recount because the race was so close, and the Greens held two.

Walker won the Parksville-Qualicum riding with 42 per cent of the vote against Stilwell’s 35.47 per cent.

Green candidate Rob Lyon took 16.62 per cent of votes, while the remainder were split between the Conservative and Independent candidates.

In 2017, Stilwell won 45.13 per cent of the vote, defeating Sue Powell of the NDP by a margin of 16.47 percentage points.

The election makes John Horgan the second two-term NDP premier in B.C. history, following a campaign that was marked by the pandemic.

His opponents took aim at him throughout the campaign for what they called an “unnecessary” election during a public health emergency when British Columbians need a steady hand most.

But voters ultimately rewarded Horgan for the gamble.

“This has been an extraordinarily difficult election for many, many reasons, but it's one that I believe had to happen,” Horgan said on election night.

“I'm grateful for all British Columbians that we have put the election behind us and we can get back to focusing on the things that matter most to you.”

With files from the Canadian Press