It comes after Mr Trump repeatedly suggested that Canada should become America’s 51st state.
Prime Minister Mark Carney later invited Charles, who is the head of state in Canada, to the state opening of parliament.
On Tuesday, Charles said in a speech, written by Mr Carney’s government to open Canada’s parliament, that the country would remain “strong and free”, quoting the national anthem, but did not directly refer to Mr Trump’s annexation threats.
“We must face reality: since the Second World War, our world has never been more dangerous and unstable. Canada is facing challenges that, in our lifetimes, are unprecedented,” the King told politicians in the Senate Building in Ottawa in French.
“Many Canadians are feeling anxious and worried about the drastically changing world around them,” he added.
In the speech, he highlighted his admiration for “Canada’s unique identity, which is recognised across the world for bravery and sacrifice in defence of national values”.
He set out the government’s legislative agenda on the second day of his Canada visit, an honour usually reserved for the governor general.
King Charles is only the second monarch, after his mother Queen Elizabeth II, to do so. The late queen delivered the speech at the state opening of the Canadian parliament in 1957, her first visit to the country as head of state, and again in 1977.
He said that it has been nearly 70 years since his mother first opened the Canadian parliament, and at the time, World War II remained a painful memory while the Cold War was intensifying simultaneously.
“Freedom and democracy were under threat,” the King said.
“Today, Canada faces another critical moment. Democracy, pluralism, the rule of law, self-determination, and freedom are values which Canadians hold dear, and ones which the government is determined to protect.”
He added that since Queen Elizabeth II’s first Canadian parliament opening, the country “has dramatically changed: repatriating its constitution, achieving full independence, and witnessing immense growth”.
Addressing the protection of Canada’s sovereignty, Charles read out a promise by the Canadian government that it would rebuild, rearm and reinvest in its armed forces.
“It will invest to strengthen its presence in the north, as this region, which is an integral part of the Canadian nation, faces new threats,” he read.
The speech, which was awarded a standing ovation by attendees, was largely written by officials working for Mr Carney’s government, with Charles adding his own comments about his love for Canada.
The King opening Canada’s parliament is a “clear message of sovereignty” and “not coincidental”, Mr Carney previously said.
Read more from Sky News:
Carney: Canadians facing ‘biggest crisis’ of their life
Canada will ‘never be part of US’, country’s PM says
He also revealed that Canadians “weren’t impressed” by the decision of the UK government to offer Mr Trump an unprecedented second state visit to the UK.
Mr Carney said the invitation Sir Keir Starmer handed to the US president earlier this year “cut across clear messages” that the Canadian government was trying to send to the White House in response to their threats against Canada’s sovereignty, including Mr Trump’s idea for it to be America’s 51st state.