When nearly a dozen members of the far-right Proud Boys assaulted a handful of black-clad protesters on the Upper East Side last year, videos of the fighting generated outrage and drew comparisons to similar conflicts between the right and left that had taken place across the country.

Those battles — in places like Berkeley, Calif., Portland, Ore., and Charlottesville, Va. — pitted far-right groups denouncing communism against self-described anti-fascists known as Antifa, who say that the right-wing groups are a threat that should be countered with physical force.

On Tuesday, a State Supreme Court judge in Manhattan cited that recent history as he sentenced two members of the Proud Boys, Maxwell Hare and John Kinsman, each to four years in prison, for taking part in a “political street fight.”

Justice Mark Dwyer said the punishment was meant in part to deter others who seek to resolve political differences through partisan violence.