The Progressive Conservatives have held on to the riding of Whitby-Oshawa, successfully fending off a strong challenge from the governing Liberals, including a late-campaign boost by the prime minister.
With all 76 polls reporting, MPP-elect Lorne Coe had more than 52 per cent of the vote, well ahead of Liberal candidate Elizabeth Roy at just over 27 per cent support.
NDP candidate Niki Lundquist trailed with just over 16 per cent support, while Green Party candidate Stacey Leadbetter garnered a little less than 2 per cent of the vote.
The PCs held on to a riding that had been a family dynasty until Christine Elliott resigned the seat last summer after losing her party's leadership race to Patrick Brown.
Elliott had held the riding since 2006. Prior to that, her late husband, Jim Flaherty, was the area's MPP for 10 years.
Brown declared Coe's victory "a sign of things to come across the province."
"Congratulations to our newest member of the PC caucus, MPP Lorne Coe," Brown told supporters at Coe's victory party Thursday night.
"It has a nice ring to it, doesn't it?"
Brown couldn't resist getting in a dig at Prime Minister Justin Trudeau, who brought his "sunny ways" governing mantra to the riding earlier this week when he attended a campaign rally for Roy alongside Premier Kathleen Wynne.
"It's nice to see that sunny ways have come with blue skies here in Whitby-Oshawa," Brown said.
He added that he could think of no better candidate to fill Flaherty's and Elliott's shoes.
"Lorne has lived and breathed Whitby-Oshawa for 30 years," Brown said. Coe served on local council for 13 years.
Coe said his easy victory makes clear that "residents in Whitby-Oshawa are demanding a higher standard of governance than we've witnessed for the past decade."
Coe will take his seat at Queen's Park when the legislature resumes on Tuesday, after the Family Day holiday.
'Tonight is not a loss'
After it was clear Coe had won, Roy thanked supporters, saying that "tonight is not a loss. Tonight is an opportunity for us to move forward."
Even though Roy finished well behind Coe, the premier said Thursday that she hopes Roy will remain "part of our family for a long time."
While more than 111,000 voters were registered to cast a ballot in the byelection, voter turnout was just over 28 per cent, according to Elections Ontario.
Earlier Thursday, the agency said turnout in advance polls was up slightly from the 2014 general election. Preliminary figures indicated that 6,861 voters cast their ballot in an advance poll, compared to 6,613 in Whitby-Oshawa in 2014.
Meanwhile, Elections Ontario's pilot project to test electronic voting machines seems to have gone off smoothly. Forty-two of the riding's 76 polls used electronic voting machines Thursday. In addition to the voting machines, a scanning machine was used to electronically check off names from the voting list.