The videos were released as part of a $1.7 million settlement with Sonoma County in California.

A California sheriff posted a video of himself discussing a $1.7 million settlement made public on Monday in a case involving seven inmates who were beaten.

And a California lawyer edited his own video by adding videos of the beatings to the sheriff's video, which can be seen above, showing corrections officers dressed in full riot gear torturing and taunting inmates inside the county jail.

Accompanying the violent videos, Sonoma County Sheriff Rob Giordano apologizes for the behavior and tells the public that all county corrections officers have been retrained and will soon be issued body cameras. More cameras will also be placed in the common areas of the jail.

Giordano explains that their goal was to "counsel" inmates who were known to cause trouble, video recording themselves in the process, only to later learn in the settlement that their counseling sessions were hardly therapeutic.

It is not clear at this time if publishing the video was part of the settlement agreement.

The attorney representing the inmates was Izaak Schwaiger, who posted the video to his Facebook page.

The case stems from an incident on May 28, 2015, when jail staff responded to a disturbance in a high-security wing of the main jail in Santa Rosa. Inmates were, one-by-one, taken out of their cells by a group of correctional officers. They were yelled at while handcuffed and being restrained face-down on the ground with their legs and arms held behind their backs, according to sheriff’s officials and videos of the incident taken by sheriff’s personnel.

“Some of the things we did were unacceptable,” Giordano said.

Video of the incident, taken by sheriff’s personnel and posted online by the former inmates’ lawyer, include a moment with correctional deputies in tactical gear holding an inmate on the ground, folding his legs backwards. In an expletive-filled burst directed at the inmate, one deputy said: “… acting like a little f.....g bitch. Cause that’s what you are. And guess what? I run this f.....g unit. I own you.”

Seven men, all former jail inmates, joined the federal civil rights lawsuit, filed in October 2015 in U.S. District Court in San Francisco. Izaak Schwaiger, the former inmates’ attorney, said up to 20 inmates were beaten in a continuous round of assaults sanctioned through a formal sheriff’s policy called “yard counseling” or “behavior counseling” started about 20 years ago by Assistant Sheriff Randall Walker. Walker ran Sonoma County’s two jails until April when he was placed on administrative leave due to an undisclosed personnel investigation.

"We made some mistakes three years ago," Sheriff Giordano says in closing out the video. "We're settling that case today. We made the changes to make it right for this community."