A self-professed member of the Proud Boys from Texas who traveled to Portland, Ore., to confront protesters there last year was sentenced on Friday to 10 years in prison for shooting a man in the eye with a paintball gun, spraying people in the face with bear mace and aiming a loaded handgun at a crowd, prosecutors said.

The Texas man, Alan Swinney, 51, was a “white nationalist vigilante cowboy,” who went to Portland to engage in political violence during protests there in the summer of 2020, prosecutors said.

In social media posts, he made threats against “the left” and “antifa,” prosecutors said, and he tried to recruit people to form a militia to fight in what he believed was a civil war.

Mr. Swinney, who appeared at several demonstrations in the Northwest, became a “known entity” in Portland, as he instigated and committed violent acts under the banner of free speech and pro-police sentiments, prosecutors said.