A Flushing Queens man was sentenced for shooting at two plainclothes NYPD officers while they were on patrol in Jamaica Queens in 2016, prosecutors announced Wednesday.

Jamel Ethridge, 40, was convicted of second-degree attempted murder and second-degree criminal possession of a weapon after a four-week trial. He was sentenced to 25 years in prison on the attempted murder conviction and 15 years for illegally possessing a weapon. These sentences will run consecutively and will begin after Ethridge completes the seven years he is currently serving on a previous weapons conviction, QNS reports.

According to charges, on Oct. 28, 2016, NYPD Lieutenant Melody Robinson and Police Officer Rafi Mashriqi were patrolling the Baisley Park Houses at around 9:30 p.m. when they saw Ethridge outside of the complex. Ethridge rushed into the building, aimed a firearm at the officers and pulled the trigger.

The officers fired back, hitting Ethridge in the leg. Ethridge tried to flee the scene tossed the loaded 9mm handgun down a trash chute. Police later found the weapon inside the building’s trash compactor. Ethridge’s fingerprint was found near the trigger of the firearm and his DNA was also present on the gun.