A man armed with a knife has been arrested after an incident during a military ceremony on Parliament Hill in the Canadian capital of Ottawa, the defense ministry said, adding that no one had been injured.

The arrest rattled a country already on edge; hours earlier, a gunman had shot dead two people in Toronto, Canada’s largest city, although there was no immediate suggestion that the two incidents were related.

In a statement, the ministry said an incident “involving a man with a knife” took place during the changing of the guard ceremony, which features red-suited soldiers in black hats and is popular with tourists.

“The potential threat was identified and neutralized. No one was injured during this incident,” the statement said. It gave no further details.

Harjit Sajjan, Canada’s defence minister, said he had been briefed after the incident. “Relieved that no one was injured,” he wrote on social media.

Ottawa police are investigating the matter. On Monday they said a 24-year-old man had been taken into police custody but declined to comment further.

Security on Parliament Hill was boosted significantly in 2014 after an armed man shot dead a soldier in central Ottawa and then stormed into a parliamentary building. He was shot dead by police and security guards.

