Police Officer David Afanador of the NYPD leaves state court in New York City, Nov. 5, 2014. (AP File Photo)  (AP Images)

A former NYPD officer who twice was accused of brutality is going to prison in connection to an unrelated crime: firing an illegal semiautomatic handgun into the Atlantic Ocean while he was drinking alcohol on a beach on Long Island.

On Thursday, Judge Robert Bogle sentenced David Afanador, 41, of Long Beach, to between 16 months and four years in prison. Afanador had pleaded guilty to a charge of criminal possession of a firearm, a felony, back in March.

On March 21, 2021, Long Beach police officers responding to a call of shots fired near Franklin Boulevard and Ocean Beach Park came upon Afanador and three other people on the beach, the Nassau County District Attorney’s Office said. Afanador was holding an open can of hard seltzer and had a 9mm Beretta pistol in a holster and two loaded magazines, police said. Cops found seven spent 9mm shell casings in the sand near him, according to the DA.

Afanador was off-duty and wasn’t authorized to carry a firearm because of a pending criminal case for allegedly putting a Black man in a banned chokehold while responding to a call on the boardwalk at Rockaway Beach, according to the NYPD and the DA. (A Queens grand jury later declined to indict him for that incident, the New York Post reported.)

When the officers asked to see Afanador’s ID, he handed them a driver’s license and his NYPD officer identification card, which was clearly marked “No Firearms,” the DA’s office said.

“This defendant knew he could not legally possess a firearm, but still made the decision to drink with friends on a beach and recklessly fire a loaded gun several times into the ocean,” District Attorney Anne Donnelly said in a statement. “Afanador’s behavior was foolish, dangerous, and illegal. We hope that his sentence sends a message to anyone thinking about illegally discharging a weapon in Nassau County in the name of fun.”

In 2016, Affandor was acquitted of pistol-whipping a teenager during a drug bust. He resigned from the NYPD shortly after his arrest in Long Beach. He had been with the department for more than 16 years.

A woman who was with Afanador at the time of the incident is also facing a felony charge in connection with firing the Beretta into the ocean, the DA’s office said. Her case is pending.

With The Associated Press.