Premier Dalton McGuinty's carefully plotted plan to win the majority that eluded his governing Liberals 11 months ago has gone off course, with the New Democrats emerging victorious in a key by-election.

Catherine Fife, 43, rode to victory in the Southern Ontario riding of Kitchener-Waterloo Thursday evening on a wave of discontent over the Liberals' push to rein in wages for public-sector workers, notably the province's secondary and elementary teachers.

In a riding where the stakes were enormously high for all three party leaders, victory was particularly sweet for the New Democrats, whose fortunes have been on the ascent since the provincial election last October.

Story continues below advertisement

It was not all bad news for the Liberals. They easily won a second by-election on Thursday in Vaughan, a riding north of Toronto that they have held since 2001.

The campaign in Kitchener-Waterloo was inextricably linked to the government's fight with teachers, with the NDP and union leaders accusing the Liberals of "manufacturing a crisis in education."

The NDP owes some of its success in a riding that had been a Progressive Conservative stronghold for more than two decades to their long-time allies in the labour movement.

Union leaders were out in force in the riding on Thursday, knocking on doors to get out the vote for the NDP. They also issued statements, decrying the government's attempts to "vilify" teachers. Their efforts persuaded many disgruntled teachers to defect from the Liberals to the NDP.

An elated NDP Leader Andrea Horwath attributed her party's first-ever win in the riding to voters being turned off by Mr. McGuinty's "cynical" politics.

"They don't like the sandbox politics," she said.

Mr. McGuinty congratulated New Democrat Ms. Fife for her win in Kitchener-Waterloo.

Story continues below advertisement

"We're going to have to find a way obviously to keep working with the opposition parties and to make progress on behalf of Ontarians," the Premier told reporters.

Mr. McGuinty said, however, his Liberal government would not back down from its contentious legislation that would freeze teachers' wages. He said his government plans to introduce additional legislation targeting the broader public sector this fall.

"We've got to find a way to hit the pause button on public-sector pay rather than make cuts to our services," said the Premier, whose government faces a $15-billion projected deficit.

Progressive Conservative Leader Tim Hudak issued a statement Thursday night, saying the public-sector unions "bought" Kitchener-Waterloo.

In Vaughan, hundreds of Liberal supporters packed a banquet hall to take in the by-election results, erupting into loud cheers as Liberal candidate Steven Del Duca was declared the winner. He won handily over his main rival, Conservative contender Tony Genco, who was once a federal Liberal candidate but switched camps last year.

Mr. Del Duca walked into the banquet hall alongside Mr. McGuinty just before 10:40 p.m. Boisterous applause and chants of "Steven" greeted the pair.

Story continues below advertisement

Veteran Liberal Greg Sorbara announced his retirement from political office last month, triggering the Vaughan by-election. A confidant of the Premier and a key architect of Liberal victories in the past three elections, Mr. Sorbara plans to remain with the party as its campaign chair.

Mr. Del Duca, a first-time provincial candidate, ran Mr. Sorbara's 2011 re-election bid. A resident of Vaughan since 1987, the 39-year-old is director of public affairs for the Carpenters District Council of Ontario and was a special assistant to Mr. McGuinty when he was Opposition leader.

Mr. McGuinty triggered the Kitchener-Waterloo by-election last April in the hopes of regaining a majority. The Liberals were re-elected to a third term in last October's provincial election just one seat shy of a majority. A win in Kitchener-Waterloo would have handed them a de facto majority in the 107-seat legislature.

Mr. McGuinty's appointment of veteran Progressive Conservative MPP Elizabeth Witmer to chairwoman of the Workplace Safety and Insurance Board paved the way for the by-election. She was a Red Tory and a popular MPP who represented the riding for 22 years.

The Liberals saw Kitchener-Waterloo as a natural fit for them. The Southern Ontario riding, which consists of the city of Waterloo and a portion of neighbouring Kitchener, has gone through dramatic change in recent years. With the closing of one manufacturing plant after another, it has shed its blue-collar roots and evolved into an affluent riding that is home to two universities, BlackBerry-maker Research In Motion and one of the province's best-educated populations.

The riding has long been the exclusive battleground of the Conservatives and the Liberals. But not this time around.

Story continues below advertisement

This was the second election campaign for Ms. Fife, a former president of the Ontario Public School Boards' Association and self-described political moderate. She finished third in the 2007 provincial campaign.

"I'm excited and I'm humbled to be joined by Andrea Horwath and the amazing team of New Democrats at Queen's Park," Ms. Fife told hundreds of cheering supporters packed into the cavernous St. George's Hall.