Justin Trudeau votes with his family in Montreal, Quebec.

Canada's ruling Liberals took an early lead after polls closed in four provinces on Monday, as Prime Minister Justin Trudeau battled to remain in power after two major scandals and a spirited challenge by the opposition Conservatives.

The Liberals were leading or elected in 25 of 32 electoral districts in Atlantic Canada by 8:30 p.m. EDT (0030 GMT on Tuesday) despite a drop in their overall popular vote from the 2015 election, according to the Canadian Broadcasting Corp.

Some Liberal losses had been expected in the region after Trudeau led the party to a clean sweep there four years ago. Atlantic Canada makes up less than 10% of the seats in the House of Commons.

The national race was expected to be closer as Trudeau, who took power as a charismatic figure promising "sunny ways," battles Conservative leader Andrew Scheer for the chance to form the next government.

Polls close in the vote-rich provinces of Ontario and Quebec at 9:30 p.m. EDT (0130 GMT on Tuesday). National voting is scheduled to end in the Pacific Coast province of British Columbia at 10 p.m. EDT (0200 GMT on Tuesday)

Trudeau, 47, the Liberal Party leader, was endorsed by former U.S. President Barack Obama in the final stretch of the campaign and is viewed as one of the last remaining progressive leaders among the world's major democracies.

But he was shaken during the campaign by a blackface scandal and has been dogged by criticism of his handling of a corruption case involving a major Canadian construction company. Trudeau, the son of the late Liberal Prime Minister Pierre Trudeau, has also had to overcome a sense of fatigue with his government.

Trudeau, accompanied by his family, voted in Montreal on Monday after a marathon sprint campaigning across the country in the past four days. Scheer voted in his Saskatchewan electoral district.

On Twitter, he repeatedly urged people to get out and vote. Voter turnout is crucial for the Liberals, who privately fear low engagement will affect them more than the Conservatives.

"The truth is it's a coin toss right now," Ipsos pollster Darrell Bricker said.

A year ago, no one would have predicted that Trudeau risked becoming the first prime minister since the 1930s to secure a parliamentary majority and then fail to win a second term.

The latest opinion polls suggest he may narrowly avert that result and could win a minority in the 338-seat House of Commons. That would still leave him in a weakened position and needing the support of left-leaning opposition parties to push through key pieces of legislation.

"(A minority government) would force people to talk to each other, which is what we need," said Naomi Higgins, a 25-year-old voter in Toronto who supported the Liberals four years ago but switched to the Greens in this election. "We need to ... start doing what's best for everyone instead of what makes one party or the other look best."

Liberal campaign strategists say four members of Trudeau's Cabinet could lose their parliamentary seats, including Public Safety Minister Ralph Goodale, a veteran member of parliament who is seen as one of the government's heavyweights.

Goodale, 70, is the only Liberal member of parliament from the western province of Saskatchewan, where anger at Trudeau is mounting over federal environmental policies that the energy industry says will harm output.

The oil industry's top lobbying group has blamed Trudeau's policies for throttling investment in the sector, and some global energy companies have shed assets in the oil sands region of Alberta, the country's main oil-producing province.

Canada's economy, however, has been on a general upswing in 2019. The Canadian dollar has been the best-performing G10 currency this year, rising more than 4% against its U.S. counterpart, as the economy added jobs at a robust pace and inflation stayed closed to the Bank of Canada's 2% target.

BUMPY CAMPAIGN RIDE

The six-week official campaign period has been a rough and meandering ride with dirty tactics on both sides.

The liberal image of Trudeau, who has championed diversity as prime minister and whose father opened the country to mass immigration, took a severe blow when pictures emerged early in the campaign of him wearing blackface in the early 1990s and in 2001.

Trudeau had already been wrestling with the fallout from accusations he pressured his justice minister to help shield engineering firm SNC-Lavalin Group Inc from corruption charges. In August, a top watchdog said Trudeau breached ethics rules.

Scheer also has proven to be a determined opponent.

"He can't even remember how many times he put blackface on, because the fact of the matter is he's always wearing a mask," Scheer said during a leaders' debate. "Mr. Trudeau, you are a phony and you are a fraud and you do not deserve to govern this country."

Scheer, 40, is also promising to balance the federal budget and eliminate a "carbon tax" on fossil fuels. He is running his first campaign as party leader after winning a bitter leadership fight in 2017.

Given the fact that neither of the front-runners could come away with a parliamentary majority, it is the smaller left-leaning New Democratic Party (NDP) or the separatist Bloc Quebecois that could end up holding the balance of power.

"I am a lifelong Liberal voter and I am stumped on this one, mostly because I am really concerned about a Conservative win and just trying to figure out how to vote strategically," said Kristin Street, 33, a strategy manager at a computer games company, in Port Moody, British Columbia.

EKOS Research pollster Frank Graves said the Liberals needed turnout to be similar to four years ago or otherwise the Conservatives may have an edge.

"We may well be waiting until the final vote tallies in British Columbia to see who will win on Monday," Graves said.