A former U.S. Army infantryman with combat experience in Afghanistan was arrested Friday for planning to detonate an improvised explosive device (IED) at a political rally in Long Beach, California over the weekend — a terror plot federal officials said was designed to inflict "mass casualties" and avenge recent attacks against Muslims across the world.

Mark Steven Domingo, 26, a resident of Reseda, California, received what he thought was a live bomb — but was actually inert — from an undercover FBI officer involved in a Joint Terrorism Task Force investigation, the Justice Department announced Monday.

"This investigation successfully disrupted a very real threat posed by a trained combat soldier who repeatedly stated he wanted to cause the maximum number of casualties," U.S. Attorney for the Central District of California Nick Hanna said Monday.

Get Breaking News Delivered to Your Inbox

Federal prosecutors unsealed a criminal complaint filed Saturday that charged Domingo with providing and trying to provide material support to terrorists. Domingo appeared Monday afternoon in court to face charges.

Mark Steven Domingo, 26, appears in court Mon., April 29, 2019. Bill Robles

The Afghanistan war veteran, according to a 30-page affidavit supporting the criminal complaint, asked an associate, who was in fact cooperating with the FBI, to find him a bomb-maker. According to the affidavit, Domingo purchased three-inch nails because "they would be long enough to penetrate the human body and puncture internal organs." He gave the nails to the associate to be used in the bomb and then said the operation would go forward.

In one conversation described in court documents, the undercover FBI agent warned Domingo that he would probably be caught by authorities if he went ahead with his plan.

"Martyrdom, bro," Domingo replied, according to prosecutors.

On Friday, the undercover operative gave Domingo "multiple inert devices" that Domingo believed to be live bombs. The Army veteran, according to the affidavit, expected his terror plot to kill "at least" 20 people and injure 30 others. When he headed to the Long Beach park where he planned to carry out his attack later in the day, Domingo was arrested by FBI agents.

Domingo had written online posts and said in conversations with an FBI source that he supported violent jihad. According to the Justice Department, Domingo wanted to "seek retribution" for attacks against Muslims. After the mass shooting at mosques in Christchurch, New Zealand in March, Domingo wrote in a social media post that "there must be retribution."

The Justice Department release said that after that post, the undercover operative began to engage Domingo in online conversations and later met him in person. And Doming had spoken with the operative about possible targets — including Jewish people, police officers, churches and a military base, according to the affidavit. Officials said the Army veteran also considered carrying out a drive-by shooting with an AK-47-style assault rifle he owned.

According to prosecutors, Domingo had declared his fidelity to Islam on March 2.

Thom Mrozek of the U.S. Attorney's Office briefs the media beside photographs of a suspect arrested in connection with an alleged terror plot targeting Southern California sites on April 29, 2019, in Los Angeles where federal and local law enforcement officials announced the results of a major counterterrorism investigation. Getty

At a press conference in Los Angeles on Monday afternoon, officials said Domingo appeared on their radar "right before" the massacre in New Zealand, stressing that they were concerned about the pace in which he became radicalized and decided to carry out a terrorist attack.

"Our biggest fear is this was a rapid mobilization from radicalization to violence," FBI special agent in charge Ryan Young told reporters. "We get asked what keeps us up at night. This is what does."