It was the last thing anyone expected.

A day of voting in Canada's province of Quebec was over, the pro-independence Parti Quebecois, had won a narrow victory and its leader, Pauline Marois, was giving her victory speech to supporters at a Montreal nightclub.

Then the unthinkable happened.

Shots rang out. Wisps of smoke poured from around the stage and security officers dragged Ms Marois away, shouting for people to leave the building.

Outside the building, police held a burly man flat on the ground and officers examined firearms, a rifle and what looked like a handgun.

Later came the horrible news that someone had entered the theatre as Ms Marois spoke and opened fire, hitting two people and wounding them severely. One later died.

A fire was set in a doorway that caused smoke and panic inside the night club, but no damage.

Police say a man in his 50s is in custody and a homicide investigation had begun.

For Ms Marois, the attack came after a day of both success and disappointment.  Yes, she had won the most seats in the election and was on course to become the first female premier in Quebec history. Her Parti Quebecois had beaten an unpopular Liberal government led by jean Charest, who had lost his own seat. They'd survived a challenge from the right by a party founded by their own dissidents.

But Ms Marois did not have a majority in Quebec's National Assembly and the Liberals weren't vanquished at all – they'd still be the official opposition with just five fewer seats than the PQ.

Before her speech was interrupted in Montreal, she was telling supporters that she would not soften or ignore her party's main policy of making Quebec an independent nation, separate from the rest of Canada.

"We want a country," she said, "and we'll have it".

But those who watch Quebec's tumultuous politics believe that Ms Marois has nothing like the conditions she needs for Quebec independence. University of Toronto politics professor Peter Loewen says she won because  voters were tired of a Liberal government seen as corrupt and inept.
 
"Polls show us that support for independence in Quebec is below 30 per cent. It's as low as it's ever been in recent memory," Professor Loewen says. "So despite the face that the party now in power is a party that would like to see an independent Quebec, the majority of Quebeckers don’t share that view."

Canada's prime minister, Stephen Harper, would certainly agree. He sent Ms Marois a message congratulating her on her victory, and urging her to help Quebeckers by not reopening divisive and emotional matters.

Ms Marois says she'll pick fights with Mr Harper over their policy differences and use his unpopularity in Quebec to build her case for independence.

All of that can wait though as voters and politicians recover from the shock of Tuesday night's attack. For the moment, people in Quebec just want to know what happened in Montreal on election night, and why.