A pesky Times Square Spider-Man wore his costume to Manhattan court Sunday as he pleaded not guilty to assault charges — and the judge warned him this was his last chance to clean up his act.

Web-slinger Abdelamine el-Khezzani is accused of kicking a Virginia woman who wouldn’t tip him after he posed for pictures with her kids Saturday. The arrest came months after he was busted for allegedly roughing up a comedy-club ticket seller.

“Have you heard the expression ‘Three strikes and you’re out’?” Justice Laura Ward asked el-Khezzani, who took off his mask but still wore his red-and-blue leotard costume for his arraignment.

“If you come to the plate and you strike out a third time, you’re out,’’ she said. “This is your second time at bat.”

Ward warned el-Khezzani, 37, that if he is arrested again, “bail will be set so high that you won’t be able to get out.”

He was released and is due in court April 6 in both cases.

El-Khezzani insisted to The Post outside the Manhattan Criminal Court building — where he struck an iconic Spidey pose — that he was innocent and said he explained to tourists Rodney Merrill, 55, and Margaretta Patman that he worked for tips before posing with their kids Saturday.

The family had stopped for pictures with el-Khezzani and a Batman on the corner of West 45th Street and Broadway.

Batman, a k a Jose Escalona, claimed to The Post that the family stiffed the costumed workers after taking photos with them.

El-Khezzani said he told Patman, “Excuse me, miss. Have a nice day, but you lied” about giving a tip.

Merrill then shouted, “Are you calling my wife a liar?” el-Khezzani said.

“You don’t want to do this in front of your kids,” el-Khezzani said he told them.

“Show me your Spider-Man skills,” Merrill then allegedly challenged before walking away.

El-Khezzani said he retorted, “Great, you walk away,” prompting the tourist to turn around and smash him with an uppercut to the neck.

El-Khezzani said he was so angry that he called police, who tracked Merrill and Patman to a nearby McDonald’s. That’s when the family claimed el-Khezzani kicked Patman, he said.

Both Merrill and el-Khezzani were arrested on assault charges. Merrill, of McLean, Va., was released on a desk-appearance ticket.

Patman denied her husband did anything wrong.

“We were not the aggressors,” she told The Post on Sunday.

“A lot of people complained about Spider-Man. He does it all the time, being aggressive.

“He was harassing my baby,” she added of el-Khezzani, who was also charged with disorderly conduct.

The incident comes as the Times Square Alliance claims 61 percent of workers in the area have had a negative encounter with the costumed characters, who frequent tourist-heavy spots, offering pictures in exchange for tips.

The group surveyed Times Square workers in October and is slated to host a news conference Monday on the costumed-character crisis, two days before a City Council hearing on legislation that would regulate pedestrian plazas.

A little more than half of the workers who said they had a bad experience with costumed characters felt unsafe after the interaction, the Alliance said.