A U.S. Army veteran was plotting a large-scale terror attack in Los Angeles as revenge for the mass shootings at two mosques in New Zealand, according to court papers released Monday.

Mark Steven Domingo, 26, boasted about amassing an arsenal of weapons, including 80 pounds of nails for a bomb, to carry out the attack in retaliation for the killing of Muslims by a white supremacist in the city of Christchurch, according to an affidavit supporting the criminal complaint.

He was arrested April 26 after he received what he thought was a live bomb but was, in fact, a phony explosive device supplied by an FBI informant, authorities said.

Mark Steven Domingo FBI

"There were mosque shootings in new Zealand," Domingo posted to a private group online after the shootings, according to federal prosecutors. "[T]here must be retribution."

Domingo allegedly added: "I feel like I should make a christians life miserable tomorrow for our fallen bros n sis in [N]ew Zealand...maybe a jews life...they shed our blood...no Muslim should have to experience this, a message needs to be sent."

An FBI informant, who was already in the private message group along with an FBI "online covert employee," made contact with Domingo two days later, the affidavit says.

Over six weeks of plotting with the informant, Domingo fantasized about murdering a laundry list of perceived enemies, including Christians, Jews, white supremacists, police officers, even his next-door neighbor.

Download the NBC News app for breaking news and politics

But he struggled to pinpoint a target or develop a plan. Asked if he was intending to get caught, Domingo offered an oddly casual response.

"Martyrdom, bro," Domingo said, according to the affidavit.

The former U.S. Army infantryman, who completed a four-month deployment to Afghanistan in January 2013, became obsessed with the idea of getting his hands on an improvised explosive device after the FBI informant said he knew someone who used to make them.

"We'll both make it. I just don't know how," Domingo said in one conversation, according to the court papers.

"I’ll be honest. I’m smart in history but I failed chemistry. Science is not my forte ... If he doesn’t want to make it, don’t force him. But ask him how. Details...F-----g to the letter details. Ask him."

Domingo, who expressed his support for the Islamic State militant group, showed up to one meeting with the FBI source armed with a rifle similar to an AK-47, the affidavit says. As the plans developed to detonating a bomb, Domingo purchased the three-inch nails "because they would be long enough to penetrate the human body and puncture internal organs,” the court papers say.

Domingo, of Reseda, was arrested as he was moving forward with plans to attack a "white nationalist rally" in Huntington Beach on April 27, according to federal prosecutors.

He was charged with providing and attempting to provide material support to terrorists.

"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," Nick Hanna, U.S. attorney for the Central District of California, said.

The indictment was unsealed roughly six weeks after a gunman opened fire at the two mosques in Christchurch, killing 50 people.

That suspect, a 28-year-old Australian national and avowed white supremacist, live-streamed the attack on Facebook using a camera mounted to his helmet.

The gunman, identified as Brenton Tarrant, has been charged with 50 counts of murder and 39 counts of attempted murder.

New Zealand Prime Minister Jacinda Ardern called the mass murder "one of New Zealand's darkest days." Less than a week later, she announced plans to ban almost all military-style semiautomatic and assault rifles.