A man on an antigovernment rampage in Downtown Brooklyn sprayed paint remover on 13 cars — including those of Borough President Marty Markowitz, his senior adviser and some judges, police sources said.

Alex Breytman, 46, was arrested Thursday afternoon in a state supreme court garage on Adams Street. The Ocean Parkway resident, believed to be emotionally disturbed, had on him a knife and a bottle of Zip Strip paint remover.

He was charged with 13 counts of criminal mischief. Each car suffered about $250 in damage, the sources said.

Markowitz senior adviser Carlos Scissura, the leading candidate for borough president in 2013, told The Post, “It’s very unfair that we have to go through this and now have to pay for damages out of our own pockets. I’m just glad no one was hurt.’’