Two Brooklyn cops ticketed a 45-year-old cyclist for riding without a helmet — erroneously citing a law that actually only applies to pedal-pushers under 14, viral video shows.

“In New York City, you should not be riding without a helmet,” one of the officers insists in the clip, shot Saturday morning near the corner of Avenue L and Bedford Avenue in Midwood.

The hapless cyclist, Ricky Bernstein, told The Post that the encounter began when he, his wife, and two other riders were pulled over by cops from the 70th Precinct for blowing through a red light around 11:05 a.m.

“He was just trying to bust my chops for everything,” said Bernstein, who admitted that all four ran through the light.

He also unsuccessfully tried to sell the cops on the idea that because the city recently passed legislation allowing cyclists to ride through some red lights — set to go on the books in the fall — the move was virtually legal.

Bernstein lost that argument and he claims the officer kept him around for nearly another hour trying to find other infractions.

“The first thing the cop says to all of us is [show us your] license or you’re getting arrested,” said Bernstein. “The whole verbal exchange went 45 minutes. He was harassing me for not having reflectors, for the pedal-assisted bike I was on.”

Bernstein, who leads citywide e-bike tours for a living, countered each of the purported accusations the officers levied against him — but couldn’t shake the claim that he was supposed to be riding with a helmet.

“A helmet’s not a law either,” the clip shows Bernstein informing the lawman.

“It’s not? OK,” replies the cop with a skeptical tone, as his partner throws up his hands.

“No, it’s not. I’m 100 percent positive,” counters Bernstein, correctly — it is only legally required for cyclists younger than 14 to don helmets.

“Please. Write all your tickets,” said Bernstein in the clip. “I’m gonna fight all of them and win them.”

As it turns out, he won’t have to — the NYPD said in a statement Tuesday that the summons was scrapped.

“The summons issued to the male for not wearing a helmet was issued in error and has been voided,” said the NYPD.

That was good news for Bernstein on Tuesday night.

“I don’t think the punishment fit the crime,” said Bernstein. “It was completely ridiculous.”

Bernstein will still have to report to court to answer the ticket for running the red light.