WASHINGTON, D.C. — Cole Allen was charged Monday with the attempted assassination of President Donald Trump after firing at Secret Service agents at the Washington Hilton during the White House Correspondents' Association dinner Saturday night, according to court records. A hearing is set for Thursday, prosecutors said.

Allen, 31, of Torrance, California, tried to race past security barricades near the hotel's ballroom, prompting an exchange of gunfire with Secret Service agents tasked with safeguarding the event, investigators said. A Secret Service officer wearing a bullet-resistant vest was shot in the vest and survived, authorities said. Trump was not injured.

"He intended to kill and fired his shotgun while trying to breach security and attack his target. Put simply, the defendant poses an uncommonly serious danger to the community if released pending trial. The defendant's lack of criminal history and other personal circumstances do not alter this conclusion," Assistant U.S. Attorney Charles Jones said. Allen has no prior criminal record, his lawyer said.

Allen reserved a room at the Washington Hilton on April 6, weeks before the event, according to an FBI affidavit. He traveled by train cross-country from California and checked into the hotel a day before the dinner, with a room reserved for the weekend, the affidavit said.

Inside his hotel room, Allen took a picture of himself outfitted with an ammunition bag, a shoulder gun holster and a sheathed knife, according to a court filing. He wore black pants, a black shirt and a red tie when he took the photograph, the filing said.

Allen repeatedly made online checks to keep track of Trump's status that night, including live coverage of the president exiting his vehicle at the hotel, according to the court filing. Preset emails with an "Apology and Explanation" attachment were sent at approximately 8:30 p.m., investigators said.

Trump attended the gala at the Washington Hilton with hundreds of journalists, authorities said. He was escorted off stage by his security team and arrived at the White House two hours later wearing a tuxedo.

"When you're impactful, they go after you. When you're not impactful, they leave you alone," Trump said. "They seem to think he was a lone wolf," he added.