According to the national broadcaster CBC/Radio Canada, the Liberal Party of Canada won Monday’s national elections when people elected Mark Carney to a full term as prime minister, selecting an experienced economist and politician to lead their nation through difficult times.

Later on Monday or early on Tuesday, the whole findings ought to be accessible. However, the voters’ choice marked a dramatic change for the Liberal Party, which only months before appeared to be doomed to lose to the Conservative Party, which was led by Pierre Poilievre, a professional politician. Since previous Prime Minister Justin Trudeau resigned in March, Mr. Carney has served as prime minister.

Candidates and many voters have called the election the most significant vote of their lives, making it extraordinary in many respects.

President Trump has dominated it with his unrelenting attention to Canada, the United States’ closest economic partner and friend. In addition to constantly threatening to invade Canada as the 51st state, Mr. Trump has placed tariffs on Canadian exports, driving the country into a recession. He reiterated that wish on social media, claiming that it would have both military and economic advantages, even as Canadians were going to the polls on Monday morning.

The American president’s position eventually helped Mr. Carney, 60, who ran as the anti-Trump candidate and focused his campaign on dealing with the United States.

For years, Mr. Poilievre, 45, and the Conservatives had dominated surveys, and Mr. Trudeau had centered his case on the claim that they were responsible for Canada’s protracted economic slump.

However, with Mr. Trudeau’s resignation and Mr. Trump’s hostility against Canada, they saw their double-digit advantage quickly disappear.

Both the domestic economy and Canada’s relationship with its southern neighbor were major concerns for Canadians as they went to the polls. Prior to the election, opinion polls indicated that concerns over affordability, particularly housing, were at the top of the list.

However, Canada’s decision on Monday also acted as a sort of vote on Mr. Trump and his treatment of the United States’ trading partners and allies.

Following Germany, this is the second big foreign election since Mr. Trump took office, and everyone is watching Canada’s response to the rift in its relationship with the United States.

However, they saw their double-digit advantage quickly disappear following Mr. Trudeau’s departure and Mr. Trump’s hostile actions toward Canada.

The relationship between Canada and its southern neighbor as well as the domestic economy were major concerns for Canadians as they went to the polls. Opinion polls before the election revealed that concerns over affordability, particularly housing, were at the top of the list.

However, Monday’s decision was also seen as a sort of referendum against Mr. Trump and the way he has been handling America’s trade partners and friends.

The world is watching Canada’s response to the rift in its relationship with the United States, as it is the second big foreign election since Mr. Trump took office, following Germany.

On Monday, it was clear that the Liberals had benefited from Mr. Carney’s character and experience. An economist with degrees from Harvard and Oxford, he was governor of the Bank of Canada during the global financial crisis of 2008 and the Bank of England during Brexit. He then became a prominent voice on climate-conscious investing and served on company boards.

Critics such as Mr. Poilievre attempted to portray Mr. Carney as an irrelevant elite who had lived outside of Canada for the majority of his adult life and had no knowledge of the nation or its citizens.

Additionally, they criticized Mr. Carney for his work experience in China, which has influenced Canadian elections, and for some of his proposed policies, which they claimed would burden Canada.