The crowded courtroom in the Chester County Justice Center on Friday evoked images of the 2013-14 school year and the auditorium where the Coatesville Area school board held its often-tumultuous meetings.

At the start of that school year, the Coatesville Area School District had accepted the resignations of the well-liked superintendent, Richard Como, and athletic director Jim Donato. The community had just learned of the reason for the abrupt departures: the discovery of racist and sexist text messages about students and staff the two officials had exchanged on district-issued cellphones. Angered parents, teachers, students and residents — some of whom the officials had mentioned by name in the texts — wanted answers. They packed board meetings for months afterward.

The resignations were the latest in a series of disgraced exits. Residents protested and marched and voted out school board members. Those loyal to Como defended the man they said they knew.

The texts drew national attention, and that of the District Attorney's Office: Not only had Como and Donato called students the n-word, a Hispanic coach "Taco," and women c—s and "pieces" in their texts, they mentioned financial mismanagement.

The district of roughly 7,000 students — one of the poorest in the region — launched its own audits and internal investigations, and spent millions of dollars in legal fees at a time when teachers were furloughed and librarians were fired, and students lacked books and other supplies. The district sued Como and Donato and its former solicitor, James Ellison, and his law firm. State and federal agencies stepped in to monitor the district.

On Friday, the final chapter in the painful saga ended when a judge sentenced Como to 3 to 23 months in county prison for theft and ethics violations. A jury convicted him in January.

He had been charged with interfering in hiring to get his son Matt a job; selling his personal electrical generator to the district, and taking money from student government, summer school tuition, and a donation to the school district, all in an effort to pay for high school championship football rings for players, himself, and others.

For the first time, Como, 71, spoke publicly about the charges against him when he addressed the court and the roughly 100 people — including former students — watching. He told the judge he had "suffered greatly" and asked for leniency.

"My time in education was very rewarding. I'm sorry it ended the way it did," he said. "I apologize to anyone I offended and for anything I did that was wrong. I didn't know I was doing anything that was wrong."

Como will lose the pension — over $180,000 annually, according to state figures — that he earned in 42 years as an educator. The judge granted the district's request to ban Como from district property.

"The manner in which you attempted to do a good thing was improper, and you're paying the price for it," Judge Thomas G. Gavin said about the championship rings at Como's sentencing in West Chester. "You have disgraced yourself."

In a statement, Matt Haverstick, the district's lawyer, said, "The district is satisfied that justice has been done and that Como is part of the past."

The District Attorney's Office charged Como and Donato in December 2014, after criticizing district officials for withholding information and hindering its 18-month investigation. Donato, the former athletic director, pleaded guilty to felony theft and conflict of interest charges for stealing $15,000 from the district. He was sentenced in August 2016 to at least two months in prison and five years' probation.

Gavin on Friday acknowledged the district had been through an ordeal.

"If ever there was a case of a house divided against itself," he said, "it's this case."

A handful of people arguing for and against prison time for Como described him alternatively as a selfish man who stole from children and deprived students of a well-rounded education, and as a dedicated educator who paid for students' SAT registrations and saved the district millions with cost-saving measures.

Coatesville School Superintendent Cathy Taschner, who replaced Como in 2014, said he "stole the trust" of the community, and it will take years for current administrators to earn back.

"His actions have had a long and damaging impact on our students, our staff and our taxpayers," Taschner said.

She and a former school board member elected after Como's departure urged the judge to show students, especially those who have found themselves standing before a judge and receiving jail time, that the law applies the same to adults in power.

Como's supporters, including the football team's chaplain, a former school board member and another of Como's sons, Michael, spoke on Como's behalf and described him as "caring" and "compassionate."

"He cared and still does care deeply for the people in Coatesville…and the students of the Coatesville Area School District," said Michael Como.

The District Attorney's Office had asked the judge to sentence Como to at least a few years in prison.

"He was the superintendent of schools, stealing from high school students and taxpayers," Assistant District Attorney Brian Burack said.

Christian J. Hoey, the Paoli-based attorney representing Como, said prosecutors misconstrued his client's actions and asked for probation. Hoey said Como's actions "do not constitute evil acts" and a "small series of events … pale in comparison to the many great achievements" in Como's career.

Gavin said it was "regrettable that the [texts] ever existed in the first place," but that in his sentencing, Como was "being judged on the public person you are, not the private person you are."

After prison, Como will serve three years' probation. He also will have to pay more than $4,000 to the high school's student council and pay nearly $7,000 in fines, which covers funds diverted to pay for the rings, the judge ruled.