A military judge has ruled the arrests of 16 U.S. Marines accused of human smuggling during a Camp Pendleton Battalion formation were unlawful and a violation of their rights, according to reports.

Video of the July mass arrest surfaced last week. The Marines were hauled out of the formation and accused of participating in a scheme to smuggle illegal immigrants into the U.S. from Mexico, according to reports.

“It sends a signal to the government, I’m not going to tolerate, and we should not tolerate, a command basically imposing the verdict before the court is ever held,” Bethany Payton-O’Brien, an attorney for one of the accused Marines told CBS 8 San Diego.

16 MARINES ARRESTED ON ACCUSATIONS RANGING FROM HUMAN SMUGGLING TO DRUGS, OFFICIALS SAY

It’s unclear, however, what impact the judge’s ruling will have on the charges against the Marines, the station reported. Charges against three of the 16 Marines were eventually dismissed by prosecutors.

The arrests were witnessed by 800 members of the 1st Battalion, 5th Marines, according to reports.

ONE MARINE KILLED, SIX HURT IN TRAINING CRASH AT CAMP PENDLETON; SECOND FATAL CRASH SINCE APRIL

Payton-O’Brien said the arrests were an attempt by commanders to exert unlawful command influence over the case, CBS 8 reported.

“The public humiliation of my client and others in the case was wrong. It was illegal and the Marine Corps' attempt to try to influence the outcome of this case and poison the jury pool,” she said.

CLICK HERE TO GET THE FOX NEWS APP

The San Diego Union-Tribune quoted the judge who issued the ruling, Col. Stephen Keane, as rejecting a prosecution argument that the arrests were done during the battalion formation to ensure safety because some of the Marines were suspected of weapons offenses.

Fox News' Travis Fedschun contributed to this report.