The Parti Quebecois had pulled ahead of the Liberals in Argenteuil riding, north of Montreal, which has been a Liberal fortress since 1966 and was once the fiefdom of Liberal leader Claude Ryan.
As ballots were counted late Monday evening, PQ challenger Roland Richer was edging Liberal Lise Proulx by almost 400 votes in an abrupt turnaround from the slight Liberal advance during the evening.
The PQ had targeted Argenteuil and Leader Pauline Marois had campaigned in the area several times, visiting the last time on Saturday. Premier Jean Charest was there on Friday to back Proulx.
Charest called the byelections after months of unrest in the province due to student protests over tuition fees which have occasionally turned violent.
An inquiry into construction industry corruption and the awarding of public contracts, which Charest resisted calling for almost two years before yielding to public pressure, has also just gotten underway.
The office of Quebec's chief returning officer put voter turnout in Argenteuil at about 25 per cent. There are a total of 41,000 voters in the riding, 83 per cent of whom are francophones.
The riding had been held by David Whissell, who quit Charest's cabinet to devote more time to his construction business.
There was better news for the Liberals in Montreal-area Lafontaine riding, where they held a comfortable lead over the PQ and Coalition For Quebec's Future.
Lafontaine became vacant earlier this year after the resignation of former Liberal Tony Tomassi, who quit his seat in the legislature to fight fraud and breach of trust charges.
Tomassi, who was once Charest's family minister, left the Liberal party and caucus in 2010 after allegations of improper use of a credit card issued by a private company to him while he was a member of the legislature.
The Liberals ran Marc Tanguay, their party president, in Lafontaine, where there is a significant Italian community. Tomassi won the riding in 2008 with a 10,181-vote majority.
Also on HuffPost