Officials said law enforcement exchanged fire with the alleged attacker and intercepted him, and “believe” the suspect fired his weapon. He was not struck, but was taken to hospital for evaluation.

Police said he was carrying two guns, as well as knives.

Investigators are reviewing writings from the suspect, which state he wanted to specifically target administration officials, a senior US official told CBS News.

One of Allen’s family members alerted police after receiving writings from him before the attack. The writings sent to family members reportedly did not specifically mention the White House Correspondents’ Dinner.

An officer who was shot and injured during the incident has been discharged from hospital. His bullet proof vest “helped us avoid a potential tragedy,” the Secret Service’s chief of communications, Anthony Guglielmi, told the BBC.

Several BBC reporters were in attendance at the dinner, and described scenes of widespread confusion following the sound of gunshots.

Gary O’Donoghue, the BBC’s Chief North America correspondent, said he heard “booming sounds”.

“Within moments, I thought – that is the low thudding sound that semi-automatic weapons make,” he said.

The room was briefly locked down, before an announcement was made that the event would be rescheduled and attendees were ushered out.

Blanche told the BBC’s US partner CBS News that investigators believe the suspect travelled to the capital by train – from Los Angeles to Chicago, before heading to DC.

Allen describes himself as a mechanical engineer, game developer and teacher on LinkedIn. He is from Torrance, California, where an address believed to be linked to him is being searched.

He will be formally charged in federal court on Monday with assault of a federal officer and using a firearm during a crime of violence, officials said.