A Kansas City, Kansas, man said he was "ridiculously ashamed" before he was sentenced Monday to four months of incarceration for joining a mob’s attack on the U.S. Capitol.

U.S. District Judge Tanya S. Chutkan also ordered 48-year-old Kasey Hopkins to pay $500 restitution in a video conference hearing. His incarceration will be followed by 24 months of probation, The Kansas City Star reports.

Hopkins acknowledged during the hearing that he was sent to prison in 2002 for a rape conviction. He said that after getting out, he tried to make amends and started a business.

WASHINGTON MAN ENTERS GUILTY PLEA FOR ROLE IN JAN. 6 CAPITOL PROTEST, FACES UP TO 6 MONTHS IN PRISON

But on Jan. 6, 2021, Hopkins breached the Capitol twice and entered a senator’s private office, where he took pictures of rioters ransacking the room.

Tear gas outside the U.S Capitol

Tear gas outside the U.S Capitol, on Jan. 6, 2021, in Washington, DC. A Kansas man who breached the Capitol twice on Jan. 6, 2021, says he was "ridiculously ashamed" of his actions before being sentenced to four months in prison. (Shay Horse/NurPhoto via Getty Images)

"I’m ridiculously ashamed to be here right now," he said, adding that "the mob mentality is a very, very real thing."

JAN. 6 RIOTER 'QANON SHAMAN' JACOB CHANSLEY SECURES EARLY RELEASE FROM PRISON TO HALFWAY HOUSE, LAWYER SAYS

Chutkan praised Hopkins for undergoing "personal transformation," but she said his involvement in the riot "boggled my mind." Court documents said that Hopkins proposed "forming a group of ‘Proud Felons for Trump’ when he heard the Proud Boys might not accept men with felony convictions."

Hopkins initially was charged with four misdemeanors, but prosecutors dropped three of them in exchange for him pleading guilty to parading, demonstrating or picketing in a Capitol building.

CLICK HERE TO GET THE FOX NEWS APP

About 1,000 people have been charged with federal crimes in the riot that temporarily halted the certification of President Joe Biden’s victory and left dozens of police officers injured.