More than two years after Elias Irizarry breached the U.S. Capitol with other Trump supporters, he wrote a letter to Judge Tanya S. Chutkan as he waited for her to determine his sentence.

“I want to make clear that I am not writing to make excuses or defend my actions,” he told Judge Chutkan, of Federal District Court in Washington. “My participation in an event like January 6th has brought great shame upon myself, my family, and, unfortunately, my country.”

Today, Mr. Irizarry, a recent graduate of the Citadel, the renowned South Carolina military college, is mounting a primary challenge to a Republican in the state’s House of Representatives. His website recently noted his prosecution for engaging in “nonviolent activities” at the Capitol on Jan. 6 as proof that he has “always stood for the conservative movement.”

“At every pivotal moment of the America First movement,” the website declared, “Elias has been there.”

The reference to Jan. 6 disappeared from the website after The New York Times discussed it with Mr. Irizarry’s federal public defender. In a text message Sunday night, Mr. Irizarry said he had initially mentioned his involvement in the Jan. 6 riots on his website bio “for the sake of transparency.”

Mr. Irizarry declined interview requests, but much of his story is detailed in his court record.

He was 19 when he entered the Capitol through a broken window, wearing a red MAGA hat and carrying a metal pole. Since then, Judge Chutkan, Republican politicians in South Carolina and the Citadel have grappled with the question of whether he deserves reproach or redemption — a question being asked, in one way or another, of many of the 1,200-plus Americans charged with taking part in the Jan. 6 attack.