Bernie Goetz said he thought he was going to be mugged by a man who turned out to be a plainclothes cop arresting him in a low-level drug sting — the same explanation he used nearly three decades ago when he opened fire on four panhandling youths on a subway train.

“I’m looking at his hands, his face, his eyes, I thought he was going to attack me,” Goetz said outside court.

He was charged last month with misdemeanor sale and possession of marijuana after he was nabbed selling $30 worth of pot to a female undercover officer he’d been flirting with in Union Square park. Manhattan prosecutors on Wednesday offered him 10 days of community service to resolve the case.

But Goetz, 65, didn’t take the deal, and he offered a rambling set of reasons why, including becoming a vegetarian, feeling coerced into taking the money from the undercover officer and believing that police are too aggressive nowadays. He said he thought the arresting officer was trying to get him to punch him to escalate the case.

“This type of hysterical war on crime, which I helped start 30 years ago, is just no longer appropriate,” he said. “The war on crime actually was won 10 years ago. What you need is a general police attitude that people in New York are well-behaved.”

In 1984, Goetz thought police weren’t aggressive enough, and he took the law into his own hands by shooting four black teens with an illegal handgun on a No. 2 train in Manhattan. At least one had a screwdriver, and they were asking him for $5. Goetz said it was self-defense and the youths intended to mug him. One of the teens was paralyzed.

The shooting brought to the surface long-smoldering urban issues of race, crime and quality of life. It also thrust Goetz, a self-employed electronics expert, into the role of spokesman for what some considered a justified form of vigilantism.

Goetz was cleared of attempted murder charges and spent 250 days in jail in 1987 for a weapons conviction in the case.

It was a very different era. Homicides reached an all-time high in the city in 1990, and crime was rampant. Goetz said you couldn’t have enough cops on the street then, but now it seems like there isn’t enough crime to go around.

Goetz wore all black to the court appearance, save for a “Love Animals. Don’t eat them” pin. He said he thought the arresting officer would not have been aggressive if he were a vegetarian.

He said he was in the park Nov. 1 feeding the squirrels when he met a woman and the two talked about getting high together, so he went to his nearby home and got some marijuana.

“She said she had to go,” he said. So he broke off a chunk of pot for her, and said she could take it, he said. She insisted on paying him, he recalled.

“After the third time, she said, ‘No I’d rather pay for it,’” he said. “And I said OK.”

She gave him $40, he gave her back $10 and then was arrested, he said.

Goetz’s lawyer had no comment, and advised him not to talk to reporters. He said he would push for a trial date.

“Either dismiss it, or let’s take it to trial and let a jury decide,” Goetz said.