TORONTO (AP) — Canadians voted Monday on whether to back their new prime minister, Mark Carney, and extend his Liberal Party's decade in power or hand control to the Conservatives and their populist leader, Pierre Poilievre. But the election was also a referendum on someone who isn't even Canadian: Donald Trump.

The U.S. president trolled Canadians on election day by suggesting on social media that he was in fact on the ballot and repeating that Canada should become the 51st state, incorrectly claiming the U.S. subsidizes Canada. “It makes no sense unless Canada is a State!” Trump wrote.

Poilievre, who has been criticized for not taking a firmer stance against Trump, responded with a post of his own.

“President Trump, stay out of our election. The only people who will decide the future of Canada are Canadians at the ballot box,” he posted. “Canada will always be proud, sovereign and independent and we will NEVER be the 51st state.”

Until Trump won a second term and began threatening Canada's economy and sovereignty, the Liberals looked headed for defeat. But 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.

Trump's attacks also put Poilievre and the opposition Conservative Party on the defensive and led to a surge in nationalism that helped the Liberals flip the election narrative.

“The Americans want to break us so they can own us,” Carney said recently, laying out what he saw as the election's stakes. “Those aren't just words. That's what's at risk.”

Election day came as the country grappled with the fallout from a deadly weekend attack at a Vancouver street fair that led to the suspension of campaigning for several hours. Police ruled out terrorism and said the suspect is a local man with a history of mental health issues.

Trump became the main issue

Poilievre and his wife walked hand-in-hand to vote in their suburban district near the nation's capital, Ottawa. “Get out to vote for a change,” he implored voters.

Poilievre had 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 and immigration surged.

But then Trump became the dominant issue, and Poilievre's similarities to the bombastic president could cost him.

“He appeals to the same sense of grievance,” Canadian historian Robert Bothwell said of the Conservative leader. “It’s like Trump standing there saying, 'I am your retribution.’”

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

Foreign policy hasn’t dominated a Canadian election this much since 1988 when, ironically, free trade with the United States was the prevailing issue.

The winner will face a litany of challenges

Canada has been dealing with a cost-of-living crisis for some time. And more than 75% of its exports go to the U.S., so Trump's threat to impose sweeping tariffs and his desire to get North American automakers to move Canada's production south could severely damage the Canadian economy.

Both Carney and Poilievre said that if elected, they would accelerate renegotiations of a free trade deal between Canada and the U.S. in a bid to end the uncertainty hurting both of their economies.

Carney has notable experience navigating economic crises after running Canada’s central bank and later becoming the first non-U.K. citizen to run the Bank of England.

Trump dialed back his talk of Canada becoming the 51st state during the campaign until last week, when he said Canada “would cease to exist as a country” if the U.S. stopped buying its goods. He also said he’s not just trolling Canada when he says it should become a state.

In response to the threats to Canadian sovereignty, Carney pleaded with voters to deliver him a strong mandate to deal with Trump.

“President Trump has some obsessive ideas, and that is one,” Carney said of his annexation threat. “It’s not a joke. It’s his very strong desire to make this happen. It’s one of the reasons why this crisis is so serious.”

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.

___

Associated Press reporter Mike Householder contributed to this report.

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

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

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