Ontario's byelections have handed the riding of Thornhill to the Progressive Conservatives and Niagara Falls to the NDP — shutting out the ruling Liberals and costing them one seat of their minority government.

In Thornhill, north of Toronto, Gila Martow steered the Tories to a win, besting Liberal contender Sandra Yeung Racco and maintaining the party's grip on the riding previously held by its finance critic, Peter Sherman.

Martow ended the night with 13,397 votes over 11,592 for the Liberals and 1,896 for Cindy Hackleberg of the New Democrats.

PC Leader Tim Hudak, who has faced recent caucus unrest, was under pressure to hold Thornhill.

"Tonight we saw proof that the people of Ontario want to see change," Hudak told a crowd of supporters in Thornhill. "And they sent the McGuinty/Wynne Liberals a very clear message that they want leadership that's going to … create jobs and get Ontario moving again."

In Niagara Falls, local city councillor Wayne Gates won the night for the NDP with 14,526 votes over former MPP Bart Maves of the Tories, who drew 13,564. Joyce Morocco trailed for the Liberals with 7,143. The riding was previously held for the Liberals by Kim Craitor.

The race in Niagara Falls was hard-fought over issues including labour and hydro rates.

"People ignored the attack ads and focused on the candidate who backed their issues," said NDP Leader Andrea Horwath.

The byelections were triggered when both Craitor and Sherman stepped down.

The loss of Niagara Falls leaves the Liberals with 48 seats in the 107-seat provincial legislature.

"This is a hard night and we're not going to pretend that it's not," Ontario Premier Kathleen Wynne told supporters in Thornhill. "We've lost these skirmishes but we're ready for the real battle."

Wynne had earlier downplayed Liberal chances ahead of the votes, calling byelections "unique creatures" that allow people to safely lodge a protest against the government.

Wynne reminded supporters she is still premier and leading a minority Liberal government. The Thornhill riding was previously held by the Progressive Conservatives.

The electorate "could vote with impunity and that's what they've done," she told the crowd.

The byelections were widely seen as a chance to test voter intentions, and party messages, in advance of a general election that could come as early as this spring.