U.S. President Joe Biden on Friday mistakenly praised China while delivering a speech to the Canadian parliament, evoking laughter from those in attendance.

The 80-year-old president, who is often criticized for making gaffes, confused Canada with China. "Today, I applaud China for stepping up," he said while speaking about Canada's immigration policy.

U.S. and Chinese flags are pictured near the venue of a summit between U.S. President Joe Biden and Chinese President Xi Jinping in Bali, Indonesia, on Nov. 14, 2022. (Kyodo)

Biden immediately corrected himself and said, "Excuse me, I applaud Canada...You can tell what I'm thinking -- about China," triggering more laughter. "I won't get into that yet."

Biden was on a two-day visit to Ottawa for talks with Canadian Prime Minister Justin Trudeau. The leaders said in a joint statement the two countries "acknowledge the serious long-term challenge to the international order posed by the People's Republic of China," referring to the country by its official name.

Making his first visit to Canada since taking office in January 2021, Biden said that the challenges include "disruptive actions such as economic coercion, non-market policies and practices, and human rights abuses."

Biden has repeatedly said China's growing clout poses the "greatest strategic challenge" in the Indo-Pacific region and elsewhere, and winning the competition against the Asian power is a top priority for his administration.

In recent years, relations between Canada and China have been tense. China was infuriated when Huawei Technologies' chief financial officer was detained in late 2018 in Vancouver on a U.S. warrant for bank fraud.

In November last year, Canada released a new Indo-Pacific strategy in which it characterized China as an "increasingly disruptive global power."