VANCOUVER - B.C. Premier Christy Clark has won a seat in the provincial legislature in a nail-biter of a vote that broke a 30-year losing streak for B.C. governments in byelections.

For much of the night, the results were virtually neck-and-neck, but Clark later pulled ahead of her NDP opponent and stayed there. Even when out front, only about 300 votes separated the two for most of the time, though Clark steadily widened the gap.

When all the votes were counted, Clark won with 7,371 to the NDP candidate David Eby's 6,776. Clark garnered 49 per cent of the popular vote to Eby's 45.

Clark acknowledged the results might be regarded by some as a "squeaker."

"But you know what: When (Vancouver Canuck) Henrik Sedin is holding the Stanley Cup over his head, and he's doing it on Game 7 after the third overtime, not a single one of us is going to complain that he won."

She noted a B.C. government of any stripe hasn't won a byelection in 30 years.

Her predecessor, former premier Gordon Campbell, won the Vancouver Point-Grey riding in the last two elections by about 10 per cent.

But as the final ballots were being counted, Clark was ahead of Evy, a prominent civil liberties lawyer, by only about four per cent.

"I guess there were a few anxious moments, but nothing that upset me too much," she said.

The Eby camp was boistrous, despite the loss.

"Do you realize what we did tonight? We almost beat the premier tonight," Eby said with a smile to cheering supporters.

It was his first campaign, and he said in an interview he's thrilled with the results.

"It's hard to imagine, short of a win, how we could have done better. To be within such a close margin of the premier, to make them sweat like this and to do it all in my first run in provincial politics was totally amazing. I'm so psyched I'm not sure I'll sleep tonight."

Voter turnout was low, with 7,858 fewer people casting ballots in the affluent, west Vancouver riding this time as in the provincial election two years ago.

The byelection win means Clark will now be able to fully get down to the job she won in February's Liberal leadership race.

The first to congratulate her was B.C. MP and Heritage Minister James Moore.

"British Columbia's future is bright, and our government looks forward to working with Premier Clark to grow our economy, create jobs, and seize the opportunities ahead for our province," Moore said in a statement.

Clark was expected to win the byelection all along, but she came under criticism for avoiding all-candidates debates.

She said she preferred telephone town-halls, where she could speak directly to constituents rather than face partisan hecklers, but her critics said the move made her look isolated.

Eby said in interviews he had the satisfaction of knowing that his campaign was getting to her. As evidence, he pointed to an attack pamphlet from the Clark campaign that he said was completely out of context.

The flyer painted Eby as soft on polygamists and drug dealers, but Eby said his positions as a civil liberties advocate on both those topics were hardly relevant, given both are under federal jurisdiction.

Eby and NDP Leader Adrian Dix also complained to Elections B.C. that Clark was using her position as premier to boost her byelection run. They noted a number of government announcements she made in the riding.

The byelection was made necessary after Campbell quit politics for good in March. He had won three majorities from the riding, but was forced out as Liberal leader last year over his government's handling of the harmonized sales tax.