A former Cook County sheriff’s deputy buried his head in his arms Wednesday as a federal judge sentenced him to a year behind bars for an attack on a shackled prisoner.

Rafael Munoz, 39, pleaded guilty in September to a misdemeanor civil rights charge. He confessed to deliberately knocking over the prisoner in July 2010, breaking his nose and tooth. And he admitted at the time the attack at the Maywood courthouse was unprovoked.

On Wednesday, Munoz said he felt “horrible” for what happened.

“I apologize for my actions and the people that I hurt,” Munoz said. “I’m really remorseful for everything that happened.”

A federal prosecutor played a video of the attack in U.S. Magistrate Judge Maria Valdez’s courtroom Wednesday. In the video, the detainee could first be seen kicking the door to his cell. Eventually, the door opened, Munoz entered with other guards, and then Munoz could be seen tossing the prisoner to the ground.

“You can see the blood pooling out of the victim’s face,” Assistant U.S. Attorney Andrianna Kastanek said as the video played.

Munoz showed no reaction to the video. But later, when the judge told him he’d spend a year in federal prison, Munoz soon took a seat. He placed his arms on a wooden railing and buried his head in them as the judge finished reading him the sentence.

Defense attorney Paul Flynn earlier tried to persuade the judge to let Munoz serve his sentence at home — and without electronic monitoring. Munoz quit his job in 2013, and Flynn said Munoz will never again seek a career in law enforcement. He also said Munoz would be “incredibly vulnerable” in a federal prison, because he once worked in law enforcement.

Even though his client had earlier admitted the attack was unprovoked, Flynn said the victim had been disruptive before it happened, banging his head against a wall and antagonizing the guards.

The judge agreed there was probably some provocation. But that didn’t make things better.

“You get paid not to respond to that provocation,” Valdez said.

Despite Munoz’s despair at his sentence, the judge said he was “lucky” to walk away from the incident with only a misdemeanor conviction. Munoz filed false reports after the attack, claiming the prisoner was injured when he “fell” or “rolled over” in his cell.

That just made things worse, the judge said.

“It’s not just the act, but the cover-up that gets you into trouble,” Valdez said.