A second Bridgeton, N.J., man has been charged in the shooting of a New Jersey state trooper during an ambush at a Salem County trailer park, authorities said Friday.

Authorities allege that Tremaine M. Hadden, 27, was part of a caravan that opened fire on Detective Richard Hershey during a “horrific” attack Saturday night in Pittsgrove Township, said state Attorney General Gurbir S. Grewal.

Hershey was investigating an alleged home invasion from earlier that day at the Harding Woods mobile home park when he was confronted by the occupants of a caravan of five vehicles, authorities said.

The trooper was in plainclothes and had an unmarked vehicle, authorities said. He ordered those in “the hostile mob” to get back into their vehicles, Grewal said.

The assailants, some with weapons, were linked to the home invasion, he said. A woman who lived at the trailer park had been beaten and robbed, authorities said.

Hadden and Najzeir Hutchings, 21, opened fire on Hershey from separate vehicles, Grewal said. Hershey returned fire with his service revolver, authorities said.

”We allege that there were a number of rounds fired at the trooper,” Grewal said. Investigators recovered shell casings and Hadden’s bullet-riddled car, he said.

Hershey was struck in an upper leg and underwent surgery at Cooper University Hospital in Camden, where he was listed in stable condition Friday.

A passenger in one of the vehicles was shot in a leg. She was treated and released.

Hadden was arrested Thursday night and charged with attempted murder, aggravated assault on a police officer, and weapons offenses. He was in custody pending a detention hearing. Hutchings faces the same charges.

Authorities said the incident began around 6 p.m. Saturday when five women forced their way into a home in the park on Route 40, assaulted a woman, and stole her iPhone.

The victim was treated for a broken rib and a lacerated lung. Authorities said she had a dispute with the women, and was familiar with at least two of her assailants and was able to identify them.

Grewal said one of the women, identified as Iramari Lazu, 22, allegedly returned to the trailer park with the caravan and planned to continue the assault. A motive for the attack was not disclosed.

”They came back to exact more harm,” the attorney general said.

State Police Superintendent Patrick J. Callahan noted that the announcement Friday fell on the agency’s “Survivors’ Day,” when the department honors the 75 troopers killed in the line of duty.

“It could have gone the other way,” Callahan said.

Grewal said additional charges were likely. Earlier this week, authorities announced seven other arrests in the shooting and home invasion.

Charged with weapons offenses were Kareen Warner Jr., 19, and Colby Opperman, 18, both of Bridgeton. Charged with aggravated assault, robbery, and burglary in the home invasion were Lazu and her mother, Yomari, 43; Jazmin Valentin, 32; and Mayra Roblero, 52, all of Bridgeton, and Maria Betancourt, 39, of Vineland, N.J. All were being detained.