TORONTO (AP) — Prime Minister Mark Carney’s Liberal Party won Canada’s federal election on Monday, capping a stunning turnaround in fortunes fueled by U.S. President Donald Trump’s annexation threats and trade war.

After polls closed, the Liberals were projected to win more of Parliament’s 343 seats than the Conservative Party, though it wasn’t immediately clear if they would win an outright majority — at least 172 — or would need to rely on one or more smaller parties to form a government and pass legislation.

The Liberals looked headed for a crushing defeat until the American president started attacking Canada's economy and threatening its sovereignty, suggesting it should become the 51st state. Trump's actions infuriated Canadians and stoked a surge in nationalism that helped the Liberals flip the election narrative and win a fourth-straight term in power.

“We were dead and buried in December. Now we are going to form a government,” David Lametti, a former Liberal Justice Minister, told broadcaster CTV.

“We have turned this around thanks to Mark,” he said.

The Conservative Party's leader, Pierre Poilievre, hoped to make the election a referendum on former Prime Minister Justin Trudeau, whose popularity declined toward the end of his decade in power as food and housing prices rose.

But Trump attacked, Trudeau resigned and Carney, a two-time central banker, became the Liberal Party's leader and prime minister.

Even with Canadians grappling with the fallout from a deadly weekend attack at a Vancouver street festival, Trump was trolling them on election day, suggesting on social media that he was on their ballot and repeating that Canada should become the 51st state. He also erroneously claimed that the U.S. subsidizes Canada, writing, "It makes no sense unless Canada is a State!"

Trump's truculence has infuriated many Canadians, leading many to cancel U.S. vacations, refuse to buy American goods and possibly even vote early. A record 7.3 million Canadians cast ballots before election day.

“The Americans want to break us so they can own us,” Carney said in the runup to election day. “Those aren't just words. That's what's at risk.”

As he and his wife cast their ballots in their Ottawa district on Monday, Poilievre implored voters to “Get out to vote — for a change." After running a Trump-lite campaign for weeks, though, his similarities to the bombastic American leader might have cost him.

Reid Warren, a Toronto resident, said he voted Liberal because Poilievre “sounds like mini-Trump to me.” And he said Trump’s tariffs are a worry.

“Canadians coming together from, you know, all the shade being thrown from the States is great, but it’s definitely created some turmoil, that’s for sure,” he said.

Historian Robert Bothwell said Poilievre appealed to the “same sense of grievance” as Trump, but that it ultimately cost him with voters.

“The Liberals ought to pay him," Bothwell added, referring to the U.S. president. "Trump talking is not good for the Conservatives.”

Carney and the Liberals cleared a big hurdle by winning a fourth-straight term, but they have daunting challenges ahead.

If they don't win a majority in Parliament, the Liberals might need rely on the third place party, the Bloc Québécois, to remain in power and pass legislation. The Bloc is a separatist party from the French-speaking province of Quebec that seeks independence from Canada. Trudeau’s Liberals relied on the New Democrats to remain in power for four years, the progressive party lost seats in this election.

Foreign policy hadn’t dominated a Canadian election as much as it did this year's since 1988, when, ironically, free trade with the United States was the prevailing issue.

In addition to the trade war with the U.S. and frosty relationship with Trump, Canada is dealing with a cost-of-living crisis. And more than 75% of its exports go to the U.S., so Trump's tariffs threat and his desire to get North American automakers to move Canada's production south could severely damage the Canadian economy.

While campaigning, Carney vowed that every dollar the the government collects from counter-tariffs on U.S. goods will go toward Canadian workers who are adversely affected by the trade war. He also said he plans to keep dental care in place, offer a middle-class tax cut, return immigration to sustainable levels and increase funding to Canada's public broadcaster, the Canadian Broadcasting Corporation.

___

Associated Press reporter Mike Householder contributed to this report.

Liberal Party's supporters cheer on results at the party election night headquarters in Ottawa, Monday, April 28, 2025. (Nathan Denette/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Canada's new Prime Minister and Liberal Leader Mark Carney and his wife Diana Fox Carney take in the results on election night in Ottawa, Ontario, Monday, April 28, 2025. (Sean Kilpatrick/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Canada's new Prime Minister and Liberal Leader Mark Carney casts his vote in Ottawa, Ontario, Monday, April 28, 2025. (Sean Kilpatrick/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Liberal Party supporters cheer on results at the party election night headquarters in Ottawa, Ontario, Monday, April 28, 2025. (Nathan Denette/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Liberal Party's supporters cheer on results at the party election night headquarters in Ottawa, Monday, April 28, 2025. (Nathan Denette/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Conservative Leader Pierre Poilievre, right, and his wife Anaida Poilievre cast their votes in the federal election in Ottawa, Canada, Monday, April 28, 2025 in Ottawa. (Adrian Wyld/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Liberal Party's supporters cheer on results at the party election night headquarters in Ottawa, Monday, April 28, 2025. (Nathan Denette/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

FILE - Toronto residents Douglas Bloomfield, left, and his son Phoenix, right, hold a Canadian flag and an ice hockey stick to show their support for Canada regarding trade tariffs as they pose with with another visitor to the city wearing a mask of President Donald Trump in front of the White House in Washington, March 13, 2025. (AP Photo/Ben Curtis, File)

Credit: AP

icon to expand image

Credit: AP

A sign for a federal election voting center stands near the memorial for the victims of a driver who rammed into a crowd during a Filipino heritage festival in Vancouver, British Columbia, Monday, April 28, 2025. (AP Photo/Lindsey Wasson)

Credit: AP

icon to expand image

Credit: AP

NDP Leader Jagmeet Singh arrives for a sign waving campaign event with Port Moody-Coquitlam NDP candidate Bonita Zarrillo and volunteers on election day, in Port Moody, British Columbia, Monday, April 28, 2025. (Darryl Dyck/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Elections Canada signage is seen as voters arrive at a polling station on Election Day in Halifax, Canada, Monday, April 28, 2025. (Darren Calabrese/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Liberal Leader Mark Carney arrives in Ottawa, Canada, Monday, April 28, 2025. (Sean Kilpatrick/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Conservative Leader Pierre Poilievre speaks at a rally in Oakville, Ontario, Sunday, April 27, 2025. (Laura Proctor/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

Diana Fox Carney, left, votes in Ottawa, Ontario, Monday, April 28, 2025. (Sean Kilpatrick/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP

FILE - Canadian Prime Minister Justin Trudeau, right, speaks with U.S. President Donald Trump at the start of the a plenary session at the G20 Summit in Osaka, Japan, June 29, 2019. (Adrian Wyld/The Canadian Press via AP, File)

Credit: AP

icon to expand image

Credit: AP

Voters line up at a polling location at the Collingwood Neighbourhood House in Vancouver, British Columbia, Monday, April 28, 2025. (AP Photo/Lindsey Wasson)

Credit: AP

icon to expand image

Credit: AP

A voting sign stands near a memorial for victims after a vehicle drove into a crowd during a Filipino heritage festival in Vancouver, British Columbia, Monday, April 28, 2025. (AP Photo/Lindsey Wasson)

Credit: AP

icon to expand image

Credit: AP

Canada's new Prime Minister and Liberal Leader Mark Carney and his wife Diana Fox Carney take in the results on election night in Ottawa, Ontario, Monday, April 28, 2025. (Sean Kilpatrick/The Canadian Press via AP)

Credit: AP

icon to expand image

Credit: AP