Two NYPD officers were expected to recover after a 19-year-old shot and injured them as they pursued him on foot in Queens early on Monday morning, police officials said.

According to Police Commissioner Edward Caban, the officers were part of a team in the 115th Precinct and were working to address a pattern of robberies involving perpetrators on mopeds and scooters.

Caban said that around 1:40 a.m., they spotted the 19-year-old driving a moped in the wrong direction on 82nd Street near 23rd Avenue, close to LaGuardia Airport in East Elmhurst. The officers attempted to pull the man over but he fled on foot, so they chased him for several blocks, according to the police commissioner.

That’s when the man began shooting at them and they returned fire, Caban said. He said one of the officers was shot in the leg while the other was shot on the lower left side of his bulletproof vest, and the man was shot in his right ankle.

The officers — identified by police as 26-year-olds Richard Yarusso and Christopher Abreu — were taken to Elmhurst Hospital in stable condition and were released later on Monday morning, NYPD officials said. Both officers had just a few years on the job, according to police officials who spoke at a press conference at the hospital after the incident.

“This could have gone a very different way,” Caban said, adding that the officers were in good spirits and being visited by their families. “It’s only by the grace of God that we’re not out here talking about a terrible tragedy.”

NYPD Chief of Detectives Joseph Kenny identified the suspect as 19-year-old Bernardo Raul Castro Mata and said he was allegedly involved in a string of robberies in the area, including several stolen phones and an attack on a woman whose credit card was later used at a Queens smoke shop.

Kenny said Castro Mata lives at a nearby hotel on Ditmars Boulevard that the city is using as a migrant shelter. He is originally from Venezuela, entered the country in July 2023 through Eagle Pass, Texas, and has no prior arrests in New York City, according to Kenny.

The unlicensed gun he allegedly used to shoot the officers was recovered at the scene, police officials said. They said Castro Mata was in stable condition and undergoing surgery at New York-Presbyterian Queens Hospital.

The scene was still taped off on Monday morning, with multiple evidence markers and a moped standing in the middle of the street. The location was roughly a block from the hotel where police said the suspect was staying.

Multiple residents of the family shelter, a former Courtyard by Marriott hotel now known as the Landing, said they did not believe Castro Mata was living there. A few dozen mopeds and scooters were parked outside the hotel, which residents said both men and women use for delivery work.

Michelle Siguencia, a migrant from Ecuador who is staying at the shelter with her husband and two children, said metal detectors were installed about two months ago, after a man pulled out a gun in his room during a domestic incident. She said the man was kicked out of the shelter and his gun was confiscated, but added that she didn't know where he ended up.

“They ask us to put our things aside, they take off our bags, we go through and it detects,” she said in Spanish. “There aren’t that many problems or fights here. It’s rare that there would be issues here."

As of late Monday morning, Castro Mata was still in the hospital and had not been charged, according to police.

Mopeds and scooters parked outside the hotel where NYPD officials said the suspect lives, on June 3, 2024.

At the press conference, Kenny noted that robbery patterns featuring suspects using scooters and mopeds have spiked over the last few years, from zero between Jan. 1 and June 1 of 2022 to 20 during the same period last year to more than 80 during the same period this year, comprising hundreds of incidents. “What we’ve seen in the past with these motorized scooters is they operate as a crew,” he said.

Mayor Eric Adams held up the vest that one of the officers was wearing when he was shot, and pointed to the bullet hole. “Because of this vest, a young police officer is going home,” Adams said, calling the incident a “senseless act of violence.”

NYPD officials said police are continuing to investigate the incident.

This story has been updated with additional information.