Liberal candidate and former PMO staffer Mary Ng after winning the Markham-Thornhill federal byelection in Markham, Ontario, on Monday April 3, 2017.

OTTAWA — Upstart Conservative and New Democrat candidates gave their heavily favoured Liberal rivals a bit of a scare Monday in a pair of byelections in Ontario where some of Justin Trudeau’s policies and promises played a central role.

In the Toronto-area riding of Markham-Thornhill, Liberal candidate and former PMO staffer Mary Ng defeated Ragavan Paranchothy by a margin of nearly 2,500 votes after her Conservative rival made a strong early showing.

A strong performance in the riding — long a Liberal stronghold held by ex-cabinet minister John McCallum — was critical for the Liberals, given the importance of holding Toronto if they want to form government in 2019.

It was also important for Ng, who is currently on a leave of absence from her job in Prime Minister Justin Trudeau’s office and seen by some as a strong candidate for cabinet.

“The Liberal future is in Ontario,” said political analyst Tim Powers, vice-president of Summa Strategies. “If the Liberal vote goes down in Markham-Thornhill, then they will want to spend a lot of time diagnosing what went wrong.”

That did indeed appear to be the case: with all polls reporting, Ng had claimed just 51.3 per cent of the vote, compared with 55.72 per cent in 2015. The Tory share of the vote was more than five per cent higher.

And in Ottawa-Vanier, where the New Democrats campaigned aggressively against the Liberals for breaking a promise to abandon the oft-maligned first-past-the-post electoral system, the NDP’s Emilie Taman gathered nearly 30 per cent of the vote.

It was nowhere near enough to challenge Liberal candidate Mona Fortier, however, who had about 50 per cent of the vote and nearly 4,000 votes on Taman with about three-quarters of polls reporting.

“I’m feeling really good. We had a great showing. I’m proud of what we achieved,” Taman said in an interview afterward.

“The government is going to take notice that the people of Ottawa-Vanier have their concerns…. I think it was an overall disappointment that I was hearing from people, that they didn’t really get the government they thought they were getting.”

Liberal party spokesman Braeden Caley was having none of it, calling the outcome a “phenomenal result,” also noting that the government would be getting three new female MPs.

“They’re going to be tireless champions for their communities in Parliament,” he said.

Add in Conservative Stephanie Kusie, who cruised to victory in Calgary Midnapore, and the byelections are sending four women to Parliament Hill, noted the advocacy group Equal Voice, which is committed to electing more female MPs.

That brings to 92 the total number of women in the House of Commons, representing 27 per cent of the available seats, up from 26 per cent, said spokesperson Catherine Fortin LeFaivre.

“It shows that Canadians will vote for women when their names are on the ballot, which is another reason why parties must play a key role in attracting and securing a greater number of female candidates moving forward,” she said in a statement.

“We are hopeful that tonight’s results will inspire even more women to seriously consider running for political office – Canada needs them.”

Greg MacEachern, a former Liberal strategist now at lobby firm Environics Communications, said significant inroads in Ottawa-Vanier for the NDP suggest a surprising degree of anger over the abandonment of electoral reform.

“Electoral reform came up a lot in the course of the campaign — a lot,” Taman said. “Even people for whom it was not their No. 1 priority were really, really disappointed in the way the prime minister went about breaking the promise.”

Liberal candidate Mona Fortier greets supporters after winning the Ottawa-Vanier federal byelection in Ottawa on Monday, April 3, 2017.

Three other byelections took place Monday, and their results were hardly a surprise.

In the Montreal riding of Saint-Laurent, with 70 per cent of polls reporting, Liberal candidate Emmanuella Lambropoulos had 57.3 per cent of the vote, compared with Conservative rival Jimmy Yu, a distant second at just 20.4 per cent.

Lambropoulos, a 26-year-old high school teacher, stunned many when she won the Liberal nomination contest in Saint-Laurent, defeating former Quebec cabinet minister Yolande James.

“I’m sure it will hit me a little later,” she said after her victory speech late Monday.

James had been considered the Liberal party favourite to replace Stephane Dion, the former Liberal leader who resigned his seat to become ambassador to Germany and the European Union.

“I looked up to him,” said Lambropoulos, who worked in Dion’s office in the riding, which has been held by the Liberals since it was created in the late 1980s.

“I didn’t let anything stop me. I worked really, really hard; I didn’t stop.”

The Alberta ridings of Calgary Heritage and Calgary Midnapore, formerly held by Stephen Harper and Jason Kenney, respectively, were no contest.

In Calgary Heritage, Bob Benzen claimed about 71.3 per cent of the vote with 87 per cent of polls reporting, well clear of the Liberals’ Scott Forsyth at 21.8 per cent.

In Calgary Midnapore, Kusie cruised to an easy win, posting 76.6 per cent of the vote with just over 90 per cent of polls reporting, leaving her closest rival Liberal candidate Haley Brown at 17.4 per cent.