The illegal alien accused of shooting two New York City Police Department (NYPD) officers on Monday reportedly had his deportation case dismissed by a federal immigration judge just weeks before.

Bernardo Raul Castro-Mata, a 19-year-old illegal alien from Venezuela now living in East Elmhurst, Queens, was arrested after an early morning shootout with police where NYPD officers Richard Yarusso and Christopher Abreu were both shot.

WATCH — Mayor Eric Adams Floats Giving NYC Lifeguard Jobs to Migrants Because They’re “Excellent Swimmers”:

Castro-Mata, according to the NYPD, crossed the United States-Mexico border in July 2023 near Eagle Pass, Texas. He had been staying at a migrant shelter in Queens at the time of the shooting.

On May 6, the New York Post reported, Castro-Mata had his deportation case against him closed by a federal immigration judge — less than a month before the shooting that left Yarusso and Abreu recovering in the hospital.

The dismissal of the case means Castro-Mata was not granted asylum to remain in the U.S. but also is not a priority for deportation by President Joe Biden’s administration.

WATCH — ICE Official: Sanctuary Policies Put Dangerous People in Immigrant Communities, “We Have to Go out” Constantly:

According to NYPD detectives, Castro-Mata was driving the wrong way down a one-way street on a moped in East Elmhurst when Yarusso and Abreu tried to stop him. Rather than pulling over, Castro-Mata ditched the moped and fled on foot where he then allegedly opened fire on the two officers with an illegal firearm.

While one officer was shot in the chest, the other was shot in the leg. By Monday morning, both officers had been treated at a nearby hospital and released.

Castro-Mata had prior run-ins with the law, including allegedly attacking a woman in Queens and stealing her credit card before using it at a nearby smoke shop.

Criminal charges against Castro-Mata are pending in the NYPD shooting case.

John Binder is a reporter for Breitbart News. Email him at jbinder@breitbart.com. Follow him on Twitter here.