A reputed gangbanger busted over the summer for dousing two NYPD cops with water in Brooklyn scored a slap-on-the-wrist plea deal last month — which allowed him to dodge possible jail time and instead perform community service, The Post has learned.

Courtney Thompson, 28, quietly copped to a second-degree harassment charge on Dec. 20.

As part of the agreement, he is required to serve just 10 days of community service, the Brooklyn District Attorney’s Office confirmed on Tuesday.

Thompson initially faced charges of third-degree criminal mischief, obstruction of governmental administration, criminal tampering, disorderly conduct and harassment following his July water-bucket attack on two officers in Brownsville.

Third-degree criminal mischief is punishable by up to four years behind bars.

A reputed member of a Crips gang subset, Thompson was on probation at the time of the dousing in connection with a 2015 robbery bust.

Thompson was caught on tape flinging water on two officers who responded to a call on East New York Avenue. The officers were seen walking away from the scene without making arrests while Thompson continued his aquatic attack.

The two officers gave their approval for Thompson’s plea deal before he accepted it, according to the Brooklyn DA.

“The defendant’s conduct in this case was wholly unacceptable and deserving of criminal charges,” a spokesman for the Brooklyn DA said. “We worked closely with the police department and the officer involved to come up with an appropriate resolution and to make sure that the defendant took responsibility for his actions.”

But other cops were furious about the outcome.

“I can’t believe that guy got off,” a police source said. “I mean 10 days community service? Basically, you’re telling everybody that if you want to dump water on a cop you can and there’s no consequences for it. This is the lawless society that we live in now.”

Thompson was one of several perps busted for allegedly launching water attacks on NYPD officers over this past summer — many of which ending up on viral videos.

The dousings drew the scorn of top law enforcement officials — including US Attorney General William Barr, who blasted the attacks as the work of “prancing punks.”