Ottawa/Washington: US and Canadian air defences were placed on heightened alert after a shooting in Canada’s parliament, a US defence official said.

The North American Aerospace Defence Command (Norad) “is taking appropriate and prudent steps to ensure we are adequately postured to respond quickly to any incidents involving aviation in Canada,” said the official, who spoke on condition of anonymity.

Earlier, gunfire echoed through the Gothic halls of the Canadian parliament Wednesday as police swarmed in to tackle a gunman who had shot a soldier outside before storming the building.

Initial reports at the scene suggested that one attacker had been shot by police inside the building while up to two more were feared to be at large, as officers sealed off the area.

Canadian media reported that the soldier had later died, but there was no immediate official confirmation.

Witnesses spoke of gunfire at three locations, very close to one another in the heart of the city — first at a war memorial, then in parliament and near a downtown hotel and shopping complex.

Video footage posted online by the Globe and Mail newspaper showed police ducking for cover as they advanced along a stone hallway, loud gunfire echoing among parliament’s stone columns.

Police officers outside told AFP that one or more — possibly up to three — shooters were feared to be on the roof of the building.

A member of parliament, Maurice Vellacott, said that House of Commons security had told one of his aides that at least one suspect had been killed inside parliament.

Other lawmakers tweeted reports that an assailant had been shot.

“I literally had just taken off my jacket to go into caucus. I hear this ‘pop, pop, pop,’ possibly 10 shots, don’t really know,” Liberal Party member John McKay told reporters outside.

“Suddenly the security guards come rushing down the hallways and usher us all out to the back of the parliament buildings,” he said, as lawmakers, staff and reporters scurried from the area.

CBC radio also reported that one of the suspected shooters had been killed, but there was no official confirmation.

Witnesses said they saw a man armed with a rifle running into parliament after shooting a guard at the war memorial.

Passers-by told reporters that a bearded man had gunned down the soldier and hijacked a passing vehicle to take him the short distance to Parliament Hill, on a bluff over the Ottawa River.

One witness, parliamentary aide Marc-Andre Viau, said he saw a man run into a caucus meeting at the parliament, chased by police armed with rifles who yelled “take cover.”

That was followed by “10, 15, maybe 20 shots,” possibly from an automatic weapon, he said.

“I’m shaken,” said Viau.

Police raced to seal off the parliament building and the office of Canadian Prime Minister Stephen Harper, pushing reporters and bystanders further back and blocking roads with squad cars.

Harper — who was attending a meeting with lawmakers at the time — left the area of the shooting and was “safe,” his spokesman Jason MacDonald said.

In Canada’s southern neighbour the United States, the White House said President Barack Obama had been briefed on the situation and an official said US and Canadian air defences were on alert.

The US embassy in Ottawa was placed on lockdown.

The incident came a day after 25-year-old Martin Couture-Rouleau ran over a soldier, killing him before being shot dead by police as he emerged from his wrecked car wielding a knife.

The government branded this a terrorist attack by a suspected Islamist, amid reports that Couture-Rouleau was a supporter of the so-called Daesh, a militant group operating in Iraq and Syria.

If the driver’s alleged extremist sympathies are confirmed, it would be Canada’s first ever Islamist attack, although authorities have warned they are tracking 90 suspected extremists in the country.

Authorities raised the security threat level from low to medium after the incident, which came as Canadian jets were to join the US-led air armada bombarding Islamist militants in Iraq.

“This level means that intelligence has indicated that an individual or group within Canada or abroad has the intent and capability to commit an act of terrorism,” the Public Safety Ministry said.

Outside parliament, police were seen taking cover behind vehicles, as others expanded a cordoned off area to a city block around parliament.