The racist and sexist text messages shocked, angered, and saddened students, parents, and the rest of the Coatesville Area School District. Even worse was the realization that the superintendent and athletic director were the ones exchanging the messages about students and staff on district-issued cellphones.

It's been more than four years since the discovery of those texts and the resignations of the top school officials, all of which sparked local and national outrage, local protests, and the ousting of school board members in the Chester County school district.

Then came the allegations that made a bad situation worse: The Chester County District Attorney's Office accused Richard Como, the former superintendent; and Jim Donato, the former athletic director, of stealing funds from the financially struggling school district. The pair had referenced financial mismanagement in their texts.

The trial of the 71-year-old former superintendent began Thursday, with Como painted by prosecutors as a thief and by his attorney as an unfairly targeted, dedicated educator. Como, who was superintendent for eight years, is charged with more than 40 counts of theft and ethics violations. He is accused of diverting funds from summer-school tuition, a donation to the district and student council to pay for high school football rings; interfering in the hiring process to get his son a job; and selling his electrical generator to the district, which prosecutors called a conflict of interest.

Donato pleaded guilty in 2016 to theft and ethics charges. He and Como were arrested in December 2014 after an 18-month investigation.

"This is a case about abuse of public power, public trust, and public funds," Assistant District Attorney Brian Burack said in his opening statement Thursday. "It's a case about a superintendent who used his school district to solve his own problems and fulfill his own needs."

Como's attorney, Christian Hoey, a Paoli-based lawyer and former county prosecutor, said prosecutors are misconstruing Como's actions — stressing that the school board made final hiring and buying decisions — and said the witnesses whom prosecutors plan to call "felt intimidated by these prosecutors" to testify against Como.

"You better believe today and for the next seven days in this courtroom, you better believe we're going to fight for him," Hoey said. "Pay close attention to how this 'story' came together," he said, using air quotes.

"At the end of this case, you will be left with the impression there was more to the story than was told to me by this eloquent presentation by the district attorney," Hoey said.

Chester County Court Judge Thomas G. Gavin, who accepted Donato's plea in 2016, is presiding at the trial, which is expected to last about seven days. Last January, Gavin declared a mistrial after Como's lawyer became ill during his opening statement.

After the discovery of the officials' text messages in 2013, the state's civil rights commission, the state chapter of the NAACP, and the U.S. Department of Justice helped district officials take steps to try to prevent discrimination, including improving training and communication.

But that hasn't stopped racist incidents. In the beginning of this school year, hundreds of students at Coatesville Area High School walked out of class to protest racist symbols carved on pumpkins that classmates had shown in a social media post.

Donato, the former athletic director, pleaded guilty in June 2016 to theft of $15,000 from the school district and conflict of interest. He was sentenced to a couple of months in prison. Donato took money from ticket sales at sporting events and the money groups paid to rent out the high school gym, track, and stadium.