OTTAWA -- No Canadian Armed Forces troops were hurt by the barrage of Iranian missiles that hit targets in Iraq Tuesday, Canada's chief of defence staff says.

"CAF families: I can assure you that all deployed CAF personnel are safe & accounted for following missile attacks in Iraq," Gen. Jonathan Vance said in a tweet late Tuesday. "We remain vigilant."

CAF families: I can assure you that all deployed CAF personnel are safe & accounted for following missile attacks in Iraq. We remain vigilant. — General Jonathan Vance (@CDS_Canada_CEMD) January 8, 2020

That message was echoed by Canadian Armed Forces Operations.

"Canadian Armed Forces personnel deployed in Iraq are confirmed safe after two military bases were targeted by missile attacks this evening."

According to U.S. authorities, about a dozen ballistic missiles targeted Al-Asad airbase near Baghdad and the northern city of Irbil, in the part of Iraq controlled by the country's Kurdish minority.

Canadians have long been in Irbil, working with Iraqi troops and maintaining a helicopter unit, and Canada has a diplomatic presence there as well.

Hours before the Iranian missiles hit the Canadian Forces had started to move troops out of the country.

U.S. President Donald Trump also took to social media to comment on the attack after the U.S. Defense Department said there were few, if any, casualties among its forces.

"All is well! Missiles launched from Iran at two military bases located in Iraq. Assessment of casualties & damages taking place now," Trump said on Twitter.

"So far, so good! We have the most powerful and well equipped military anywhere in the world, by far! I will be making a statement tomorrow morning."

All is well! Missiles launched from Iran at two military bases located in Iraq. Assessment of casualties & damages taking place now. So far, so good! We have the most powerful and well equipped military anywhere in the world, by far! I will be making a statement tomorrow morning. — Donald J. Trump (@realDonaldTrump) January 8, 2020

Defence Minister Harjit Sajjan and other Canadian government leaders said they were monitoring the situation.

The Canadian military's redeployment followed other Western nations concerned about the increasingly volatile standoff between the United States and Iran.

The withdrawal of an unspecified number of Canadian soldiers to Kuwait was billed by Vance as a temporary measure intended to ensure their safety and security. When -- or even if -- they will return is an open question.

In an open letter to the families of the 500 Canadian soldiers in Iraq, Vance said the safety of the troops was his top priority and that security measures were being "considered, reassessed and modified as required on a daily basis."

"Over the coming days, and as a result of Coalition and NATO planning, some of our people will be moved temporarily from Iraq to Kuwait," Vance added in the letter, which was posted on Twitter. "Simply put, we are doing this to ensure their safety and security."

Vance did not reveal how many Canadian troops were being pulled out of Iraq, and the Department of National Defence later said it would not provide that information for security reasons.

However, even as Vance described the withdrawal as temporary, he added: "Naturally, the work we are doing on these missions, and the future of operations in Iraq, remain conditional on maintaining a sufficiently secure and productive operational environment."

The Canadian contingent includes about 200 soldiers attached to a NATO mission in the south of the country that is training Iraqi counterparts in the basics of soldiering as part of the fight against the Islamic State of Iraq and the Levant.

There have also been up to 200 special-forces soldiers in the northern part of the country working with specialized Iraqi counter-terror troops while several dozen more Canadians are working with senior Iraqi officials or providing logistical, medical and other support to the rest of the contingent.

All of the Canadians were ordered to suspend their activities and hunker down over the weekend and guard against attack following the killing by a U.S. drone at the Baghdad airport of Iranian Maj.-Gen. Qassem Soleimani, who was seen as the second-most powerful person in Iran.

Soleimani's death has raised fears of Iranian reprisals against U.S. and allied forces in Iraq and the surrounding region. It has also prompted Iraq's parliament and outgoing prime minister to call for the forced withdrawal of all western troops from the country.

The withdrawal of Canadian forces from Iraq follows a similar decision by other NATO allies, including Germany, Croatia and Romania. There were also reports of U.S. forces being put on high alert over fears of Iranian drone attacks.

"In everything that we do, the safety of our personnel is paramount," a NATO official said on Tuesday. "We are taking all precautions necessary to protect our people. This includes the temporary repositioning of some personnel to different locations both inside and outside of Iraq."

Even as the Canadian Armed Forces was preparing to start moving people out of Iraq on Tuesday, Prime Minister Justin Trudeau was talking to other world leaders about the situation in the Middle East, including German Chancellor Angela Merkel and King Abdullah II of Jordan.

New Democrat Leader Jagmeet Singh said Trudeau should be talking to Canadians.

"Canadians don't want another war," Singh posted to Twitter.

"Mr. Trudeau needs to speak to Canadians and show us his plan for Canada to help calm tensions -- not follow Trump into war."

Donald Trump and senior members of his administration continued to defend Soleimani's killing, with the U.S. president calling the Iranian general a "monster," even as they insisted there was no immediate plan to withdraw American forces from Iraq.

A leaked letter from the U.S. general commanding the anti-ISIL coalition to Iraq's defence ministry on Monday suggested the coalition, to which Canada belongs, was preparing to pack up and withdraw from the country.

There were reports on Tuesday that outgoing Iraqi Prime Minister Adil Abdul-Mahdi considered the letter an official declaration of the U.S. military's planned departure, but U.S. Defense Secretary Mark Esper again dismissed the letter as a draft and said no decision had been taken.

During a news conference at the White House with his Greek counterpart, Trump said he did not know the specifics of the letter before asserting that a U.S. withdrawal would be "the worst thing that could happen to Iraq."

"If we leave, that would mean that Iran would have a much bigger foothold, and the people of Iraq do not want to see Iran run the country."

Yet Trump, who had threatened sanctions against Iraq on Monday following calls from its parliament and Abdul-Mahdi for all foreign troops to leave, also said: "We don't want to be there forever. We want to be able to get out. I didn't want to be there in the first place, to be honest."

The Iranian government, meanwhile, was continuing to warn of retaliatory attacks against U.S. forces even as a funeral was held for Soleimani.

This report by The Canadian Press was first published Jan. 7, 2020.

With files from The Associated Press