Two of the three suspected MS-13 members arrested following a bat and knife attack outside a Burger King restaurant in New York this week were previously held by Homeland Security – but were ordered released by federal judges, officials said.

Nobeli Montes Zuniga, 20, Ramon Arevalo Lopez, 19, and Oscar Canales Molina, 17, are facing second-degree assault charges related to the brawl outside the fast food restaurant in Huntington Station on Wednesday. All three entered the U.S. illegally as unaccompanied minors. Two 16-year-olds suffered injuries in the fight, one with a stab wound, according to authorities.

"While it's not clear what the groups were fighting about, one thing is clear – everyone arrested are confirmed members of MS-13," Suffolk Police Commissioner Geraldine Hart said Thursday following the announcement of their arrests.

The incident started to unfold after the victims, who were eating inside Burger King, “noticed a group of Hispanic males who they recognized from [Huntington High] school, including the three defendants, staring at them in a menacing way,” Suffolk County District Attorney Timothy Sini said in a statement obtained by Fox News. “The teens felt uncomfortable and proceeded to leave the restaurant.”

Sini says the three suspects then “allegedly charged after the teens, while wielding bats and knives, and an altercation broke out between the two groups.”

MS-13 CRACKDOWN SEVERELY REDUCES GANG’S VIOLENT CRIMINAL ACTIVITY IN NEW YORK STRONGHOLD

Police say the attack happened behind this Burger King restaurant in Huntington Station, N.Y.

Witnesses told investigators they saw Zuniga, Lopez and Molina fleeing the scene in a black car which was tracked down by police about an hour later. Officers who arrested the trio say they were found with blood on their clothing, hands and on the vehicle. Two knives also were recovered from Canales Molina, including a small one that “appeared to be covered in blood, which was found in his shoe,” the District Attorney’s Office said.

All three had their bail set at $35,000 cash or $75,000 bond during a court appearance Thursday. They face a maximum of seven years in prison if convicted.

But it is not the first time they have appeared on law enforcement’s radar – on the state or federal levels.

"All three defendants were previously confirmed as MS-13 gang members by the Suffolk County Police Department," the District Attorney's Office said. “Thereafter, Arevalo Lopez was detained by the U.S. Department of Homeland Security’s Immigration and Customs Enforcement on Oct. 24, 2017, and was ordered released from custody by a federal District Court judge on June 12, 2018. Canales Molina was detained by ICE on July 24, 2017, and was released from custody by a federal judge on Nov. 28, 2017.”

In Arevalo Lopez’s case, Robert Sweet, the district judge who ordered his release, wrote in his ruling that the El Salvadorian entered the U.S. as a 17-year-old on Dec. 6, 2016, at a crossing along California’s border with Mexico.

“Lopez told U.S. Customs and Border Protection agents that he wanted to travel to New York to live with his mother after fleeing gang threats in his home country,” Sweet said, echoing a familiar plea from those who have come to the U.S. seeking asylum.

He eventually ended up in his desired destination and “for over ten months without incident, Arevalo Lopez lived with his mother, her partner, and his older brother….in Huntington Station, New York,” the ruling said.

NEWS OUTLETS SLAMMED FOR VIDEO HUMANIZING MS-13 MEMBERS, DOWNPLAYING THREAT

But in October 2017, ICE agents – suspicious of his possible gang affiliations – appeared at his front door and asked he stop by their offices for questioning. He obliged and then, following questioning, was arrested and detained at Bergen County Jail, where he was placed with the general prison population, according to the ruling.

Less than a year later, Sweet ordered Arevalo Lopez’s release, saying federal investigators “failed to provide an explanation for why ICE detained Arevalo Lopez, other than to state that his arrest was pursuant to a Form I-200 warrant.”

“The I-200 in this case, which zeroes in on [Arevalo Lopez’s] clothing and social associations, noting in particular that his “clothing and accessories are indicative of gang membership,” does not approach “probable cause,” Sweet wrote in his ruling.

“Arevalo Lopez has no criminal history; he has never been charged with a crime in this country or any other,” he added.

His attorney, Jason Bassett, is also pushing back against police labeling Arevalo Lopez as an MS-13 gang member.

“Ramon is not a member of MS-13 (or any other gang) - being 'confirmed' in some ill-conceived database isn’t proof of anything,” Bassett told Fox News in an e-mail Friday morning. “While so many of our civil liberties have come under attack, we still cling to the idea that one is innocent until proven guilty in a court of law. Ramon is innocent of the charges against him.”

CLICK HERE TO GET THE FOX NEWS APP

The region in which the attack happened this week – New York’s Long Island – has long been a hotbed of MS-13 criminal activity.

Yet the ongoing state and Trump administration crackdown against MS-13 appears to be taking a toll on the group, as only four homicides recorded there in 2018 appeared to be linked to the gang, down from 14 the year before.