Close to a thousand anti-police protesters descended on Downtown Brooklyn Friday night, blocking traffic, vandalizing a city bus and shouting obscene insults at NYPD cops.

The demonstration formed soon after 7 p.m. on the streets near the Barclays Center, with protesters unfurling large banners that read “F—k the police” and “Don’t let these pigs touch us.” The crowd began dispersing by 9 p.m.

The demonstration was in response to a planned crackdown on fare evasion by the NYPD — and two controversial police actions in Brooklyn subway stations in recent weeks.

In one of the incidents, an NYPD cop sent straphangers scrambling in terror when he pointed his pistol toward a window from the platform at the Franklin Avenue station in Brooklyn.

In another incident, an officer was caught on camera slugging a 15-year-old boy in a wild melee at the Jay Street-MetroTech station in Downtown Brooklyn.

“That was the straw that broke the camel’s back,” one protester, a 31-year-old woman who works in media said. “I mean, it’s monstrous. My f—king tax dollars are going to this? It doesn’t make sense.”

As the protesters fanned out in the streets Friday, a group surrounded a nearby MTA bus and vandalized it with stickers and anti-cop graffiti.

“F—k NYPD” and “NYPD KKK,” they scrawled on the bus with white marker.

“They were banging on the bus, and then a kid with a white mask and a hoodie … used a marker to mark the bus,” one passenger said after getting off.

“I’m not gonna lie, it was scary,” another passenger said.

The demonstrators also made their way into the nearby Hoyt/Schemerhorn station, jumping over the turnstile and shouting obscenities at NYPD officers stationed there.

One subway rider urged the protesters to stop yelling at the officers in the station, only for the crowd to turn on her and begin hurling insults in her direction.

“I live here. This is my subway stop. I felt bad seeing the police getting bullied,” said Eve Hyman, 46, a high school teacher.

Hyman added that she’s sympathetic to the protesters message, but hates their “vitriol” and “outrage.”

Additional reporting by Ben Feuerherd