A longtime political activist and perennial candidate for elected office was arrested Saturday for allegedly assaulting a Pittsburgh cop as he tried to confront Mayor Ed Gainey during the city’s Juneteenth parade, authorities said.

Will Parker, who ran in this year’s Democratic primary for Allegheny County executive, was charged with aggravated assault and four counts of disorderly conduct, according to court records. Police said he was shouting obscenities at Mr. Gainey and that he ignored their instructions to give the mayor more space.

In a series of Twitter posts Sunday, Mr. Parker, who has also run for mayor and Congress in the past, denied any wrongdoing.

“I’m a professional protestor, I know what I’m allowed to do and what not to do,” Mr. Parker said. “I would never put my hands on anyone during any of my protest, my words are more powerful. Major Lawsuit coming.”