Obama expressed "solidarity" with Canada in the wake of attacks on Canadian forces in Quebec on Monday and shootings in Ottawa on Wednesday morning, Xinhua quoted the White House as saying in a statement.
"President Obama condemned these outrageous attacks, and reaffirmed the close friendship and alliance between our people," the statement said, adding Obama offered "any assistance" needed by Canada in responding to the attacks and that the two leaders agreed to continue coordination between their governments.
The Canadian parliament and its surrounding area were put on lockdown after multiple gunshots were fired inside the parliament building on Wednesday morning. Shootings also occurred at the National War Memorial not far away and near the Rideau Center shopping mall.
Barack Obama offered "any assistance" needed by Canada
A Canadian soldier standing guard at the memorial has died of his wound, while a gunman was killed inside the legislative building, Canadian police said.
Two days earlier, two Canadian soldiers came under attack in Quebec by a man driving a car. One soldier later died of his injuries.
On Tuesday, Canada raised its domestic terror threat level from low to medium after sending six CF-18 Hornet fighters to the Middle East to join US-led airstrikes on targets of the Islamic State inside Iraq.
The extremist group has threatened attacks on countries that are participating in the air raids.