When the FBI arrested an Army veteran in a plot to bomb a white supremacist rally in Southern California, it was the work of a confidential informant that helped snare him.

Over the course of six weeks, the informant counseled, cautioned and coaxed Mark Domingo, steering him away from rash gun attacks, offering him opportunities to quit and eventually leading him to a trap, according to court documents.

The unnamed person is one of scores of such informants the FBI has used to identify would-be terrorists and thwart their plans. The tactic is part of ramped-up counterterrorism efforts following the Sept. 11 attacks that have been hailed by law enforcement for preventing mass killings but criticized by defense lawyers and civil liberties groups for enticing vulnerable people down a path toward crime.

By the time the informant joined the case, Domingo had been spouting about violent jihad in online forums, according to court documents that spell out online chats and conversations recorded over two months.

Domingo posted an online message March 3 saying "America needs another Vegas event," an apparent reference to the 2017 mass shooting in Las Vegas that killed 59 people, documents show. He said it would spark civil unrest to weaken "America by giving them a taste of the terror they gladly spread all over the world."

Domingo, 26, a combat veteran who served four months in Afghanistan before being kicked out of the Army, recently converted to Islam and was plotting attacks across Southern California to seek revenge for killings at two New Zealand mosques in March, prosecutors say.

His plans for a bombing didn't begin to take shape until he met someone he thought shared his jihadist vision, documents say.

The informant, also operating in the same private online message group, asked Domingo on March 16 how he was feeling after the mosque slayings that killed 50.

"Still mad," Domingo wrote. He said he was keeping an assault rifle by his bed, documents show.

The two met up and over six weeks, Domingo broke bread, prayed and scoped out possible targets with this seemingly kindred soul he called "bro."

But the co-conspirator had a much different mission, one that had been ongoing since 2013, according to an affidavit filed in court by FBI Special Agent Tasha Coolidge. While not identified, the person has no criminal history and had been paid $304,524 since August 2013 for other work with the FBI, Coolidge said.

The use of such informants has been critical to disrupt terrorist plots, said Robert Chesney, a professor at the University of Texas School of Law. Investigations typically begin with a tip about someone voicing support for terrorist groups like the Islamic State or al-Qaida but eventually lead to an informant making contact to learn more.

The tactic has been criticized by lawyers for preying on innocent or mentally unstable people and cajoling them to commit a crime they wouldn't have carried out without encouragement. Some informants are criminals themselves trying to avoid prison or deportation because of immigration troubles or are incentivized by money.

"The line gets very blurry between how the FBI instructs some of these informants from moving from being informants to being agent provocateurs," said Hussam Ayloush, executive director of the Council on American-Islamic Relations for the Los Angeles area. "The majority of these cases have been manufactured, foiled and celebrated by the FBI."

The U.S. attorney and FBI declined interviews a day after a news conference on the arrest. Domingo's lawyer also would not comment.

Domingo met March 18 with the informant and discussed a range of possible targets. He talked about gunning down Jews walking to temple or police in squad cars, authorities say. He also is accused of discussing attacking a church and a National Guard Armory.

The informant questioned how he was going to get away with those crimes.

"Your plan is just to go and get caught," the informant said.

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

The informant told Domingo it was foolish to use any of his own three rifles, two of them semiautomatic, because they would be traced to him. Before they arrived at a mosque to pray, the informant said he knew someone who used to make improvised explosive devices and described how they could be placed under a car.

"That's even better," Domingo said, the affidavit shows.

Maureen O'Connell, a longtime FBI agent who now runs a consulting firm, said the informant was employing a strategy to prevent impulsive violence.

"If he really believed, and it sounds like he did, that this guy was going to rush into a church with a gun — an IED takes time," O'Connell said. "He's buying time and he's saving lives."

Defendants often claim they were entrapped by an informant, but that defense typically fails because their own words undermine them and because they have typically declined opportunities to back out of the plan, said Chesney, the law professor.

The affidavit is loaded with incriminating statements recorded of Domingo and several instances when the informant told him he didn't have to go through with the plan.

In the end, the informant connected Domingo with a purported bomb maker. Domingo supplied a bag of nails he said would be long enough to puncture internal organs when used in pressure-cooker bombs, authorities say.

But the bomb maker was an undercover police officer, and an FBI SWAT team arrested Domingo after he surveyed a park in Long Beach where he had planned to plant them, documents say.

Domingo is charged with providing material support to terrorists and could face up to 15 years in prison if convicted.