It's painful to watch cellphone or surveillance video of violence in and around schools — places that should be safe havens of learning for kids. No one wants to see repeated scenes of student-on-teacher attacks, or video of a police officer dragging a kid across a classroom or roughly pinning a teen to the ground.

The images raise an important question: Is there too much harsh policing in schools — or not enough to keep students and staff safe?

To that end, the Minneapolis school board wisely voted last week to maintain a police presence in its buildings, though it will decrease the total from 16 to 14. This week, St. Paul board members are expected to vote on a similar plan, bringing that district's officer count down from nine to seven. Both districts were recently challenged by critics to take officers out of schools entirely.

Both school boards made the right choice to back what is known as the School Resource Officer (SRO) program. Those who know the schools best support the program. In a recent poll, principals urged the Minneapolis district to keep a police presence, and so did the majority of students and staff. And in St. Paul, a recent student survey showed that 92 percent of freshmen and juniors want SROs in their buildings.

Supporters of SROs say the officers decrease crime and violence and improve response times when problems occur. Opponents argue that cops create a negative atmosphere by criminalizing minor offenses and compromising civil rights.

The Star Tribune Editorial Board has previously argued that the Minneapolis and St. Paul schools need SROs — but they must be well-trained, understand de-escalation techniques specific to children and teens, and emphasize positive interactions with kids. School cops must be more counselor, adviser and mentor to students — and less harsh enforcer.

Temperament and training clearly matter. SROs should know the difference between a minor discipline problem and an incident that requires an arrest. And they should be well-versed in dealing with kids with disabilities or mental illness issues.

St. Paul schools are seeing positive results from efforts launched last year to make student-SRO interactions more favorable. Cops now dress in light-blue polo shirts and, except in serious cases, are trained to find ways to keep students out of the court system. Arrest totals dropped from 56 in 2015-16 to five in 2016-17.

Certainly, it would be preferable if police were not needed in schools — or sports arenas, courthouses and airports, for that matter. But criminal behavior and violence are societal problems that too often invade our schools, where the majority of students want nothing more than a safe environment in which to learn and flourish.

Effective School Resource Officers help keep schools safer, and they deserve support from the communities they serve.