MONTREAL -- A 26-year-old high school teacher who was a virtual political unknown defeated a former provincial cabinet minister Wednesday to win the Liberal nomination for a federal byelection in a Montreal riding.

Emmanuella Lambropoulos and her team couldn't hold back their surprise at beating the woman considered to be the Liberal party favourite, Yolande James.

"I'm really shocked," Lambropoulos told reporters after her win in Saint-Laurent. "I didn't give up. Door to door. As soon as I knew I wanted this I worked really hard."

The Liberals said 1,353 party members voted, with Lambropoulos capturing just more than 600 votes to defeat Marwah Rizqy.

The winner's supporters credited the fact she lives in the Saint-Laurent borough and wasn't parachuted in by the Liberal party as the main reason she came away with the victory.

"We came from the bottom up," said John Babaroutsis, 22, who helped Lambropoulos secure her win. "We were the grassroots. Not from the top up like Mrs. James."

James, a former immigration minister in Jean Charest's Quebec cabinet between 2007 and 2010, had recently left her position as a political commentator for Radio-Canada to seek the nomination.

Former foreign affairs minister Stephane Dion held the riding since 1996 and it has been Liberal for decades.

The riding is considered safe for the party and Lambropoulos is likely to become its MP after the April 3byelection.

James, who was considered the heavy favourite, skipped out of a reception hall after learning she came in last out of three candidates.

Lambropoulos' win is not without controversy as the man considered to be one of the strongest candidates, if not the strongest, was not allowed to run for the nomination.

Alan DeSousa, the well-known mayor of Saint-Laurent for the past 15 years, was not told why he was rejected as a candidate.

Many Liberal party members who voted Wednesday told The Canadian Press they were disappointed DeSousa wasn't on the ballot and said they would have voted for him.

"Many people were upset," Babaroutsis said about DeSousa not being allowed to run and the party seemingly favouring James. "I think people being upset had an effect on the outcome but the most important thing is that she was able to mobilize the grassroots."

Lambropoulos was the only of the three candidates to live in the riding.

Her father, Athanasios, said her campaign started out with just him and her.

"Our goal was to hit the road and get memberships," he said. "We weren't seen by the press; we were invisible."

Her mom, Matina, said "Our headquarters was grandma's living room."

The NDP has selected Mathieu Auclair to carry its banner in the Saint-Laurent riding, while the Tories have picked Jimmy Yu, who came in second place in the 2015 election behind Dion with 20 per cent of the vote.

The Bloc Quebecois has chosen Wiliam Fayad.

Four other byelections -- two in Ontario and two in Alberta -- will also be held the same day. Both Ontario seats are also considered safe for the Liberals, while the Conservatives are expected to retain the two ridings in Alberta.

The Liberals currently have 180 seats in the 338-seat Commons. The Conservatives hold 97, the NDP has 44, there are 10 Bloc Quebecois members, one Green party member and one Independent.

Dion quit politics recently and was later named ambassador to the European Union and Germany.