The California teacher and engineer accused of opening fire outside the White House Correspondents’ Association Dinner believed it was his duty to target Trump administration officials, according to a note he sent family members about 10 minutes before the Saturday attack.

Cole Tomas Allen, 31, who lives in the Los Angeles suburb of Torrance, is the armed suspect federal authorities subdued near the packed ballroom at the Washington Hilton, where President Donald Trump and other White House officials gathered with journalists.

Allen was armed with a shotgun, handgun and knives when he rushed a security checkpoint and ran toward the ballroom where the black-tie dinner was being held, authorities said. He exchanged gunfire with law enforcement and was tackled to the ground.

Acting Attorney General Todd Blanche said on “Meet the Press” on Sunday that authorities believe “the suspect traveled by train from Los Angeles to Chicago, and then Chicago to Washington, D.C., where he checked into the hotel where the correspondents’ dinner was at in the last day or two.”

The suspect’s writings

Just moments before the attack, Allen sent family members a note apologizing to his parents, colleagues, students, bystanders and others for what he was about to do, according to a transcript of some of Allen’s writings provided to NBC News by a senior administration official.

“I don’t expect forgiveness,” Allen wrote. “Again, my sincere apologies.”

In the note, Allen criticized Trump without mentioning him by name. He wrote about lax security at the hotel, saying he had expected more.

He also described his “expected rules of engagement,” writing: “Administration officials (not including Mr. Patel): they are targets, prioritized from highest-ranking to lowest.” He appeared to be referring to FBI Director Kash Patel.

Later, he added: “I experience rage thinking about everything this administration has done.”

The senior administration official said that Allen’s brother contacted the New London Police Department in Connecticut when he received the note.

The department confirmed being contacted at around 10:49 p.m. Saturday, just over two hours after the shooting, “by an individual who expressed concern about the incident that occurred at the White House Correspondents’ Association Dinner earlier in the evening.” Police contacted federal law enforcement and the caller was interviewed by authorities.

Allen’s sister told the Secret Service and Montgomery County Police after the shooting that her brother had a tendency to make radical statements and he had referred to a plan to do “something” to fix the issues with today’s world, the senior administration official said.

Described as a ‘borderline genius’

The suspect, who was not shot but was taken to a local hospital, is expected to be charged in federal court on Monday. In a press briefing shortly after the attack, Trump called the suspected shooter a “whack job” and a “lone wolf.”

Public records and interviews show that Allen was a trained engineer who once interned for NASA, and participated in the Nerf club and Christian fellowship at his prestigious California university, before more recently developing video games and working as a part-time teacher.

Allen attended Pacific Lutheran High School in Gardena, California, where he was known for his inquisitiveness and intellect, a former volleyball teammate told NBC News. While he had not seen Allen recently, he remembered Allen as a “borderline genius” and “super stable.”

“Other people study hard,” said the ex-teammate, who spoke on the condition of anonymity out of fear it could affect his career. “He didn’t have to study. It would just come to him. He was really, really smart.”

The former teammate said Allen was interested in coding and computers, but he was also a very good writer and seemed to be well-versed in several subjects.

“Across the board, he was really knowledgeable, really curious,” the ex-teammate said.

The teammate said they lost touch with Allen once he went off to the California Institute of Technology, a private research university in Pasadena, California, but expressed surprise that he would be the suspect in Saturday’s attack.

“He was probably the most gentle person on the team, which makes it even more shocking that he did this,” the ex-teammate said.

Federal charges

Jeanine Pirro, U.S. attorney for Washington, D.C., said the suspect would be charged with two counts of using a firearm during a crime of violence and a second crime of assault on a federal officer using a dangerous weapon. She added that “many more charges” were expected to be filed.

Late Saturday night local time, the FBI and Secret Service were at a home believed to be associated with Allen in Torrance, a city of around 140,000 residents in California’s South Bay, about 15 miles southwest of downtown Los Angeles.

The FBI executed a search warrant related to the incident, said Bill Essayli, first assistant U.S. attorney for the Central District of California.

Saturday’s shooting rocked attendees of the White House Correspondents’ Association dinner, an annual event attended by the Washington press corps, presidential administration staffers and celebrities.

Trump had attended the dinner before he first became president but skipped it throughout his first term. Saturday was the first time he attended as president, and he was accompanied by first lady Melania Trump.

They and others were seated at the front of the ballroom when video captured what sounded like at least five loud bangs before armed officers rushed in and hauled the president, first lady, Vice President JD Vance and others away while other attendees ducked down under tables.

“I heard a noise and sort of thought it was a tray. I thought it was a tray going down,” Trump said from the White House briefing room Saturday night after the shooting.

“Melania was very cognizant, I think, of what happened,” the president said. “I think she knew immediately what happened. She was saying, ‘That’s a bad noise.’”