When the sergeant walked into a school, he would hear students whisper.

“Who’s in trouble?” they’d ask one another. “Who’s being arrested?”

And for a while, Salt Lake City police Sgt. Phil Eslinger acknowledged, they were right. Most of the times he went into a classroom, it was to pull kids out, question them and investigate them. That’s what he saw as his job to keep the schools safe. Even when he was looking into minor offenses. Even when he had to make an arrest.

Turns out, it was making things worse.

Some students dropped out. Some whom he disciplined got arrested again later in life. The number of crimes went up instead of down.

So after a year of studying those adverse effects — and in part due to a lawsuit — the officers who patrol Salt Lake City schools will now undergo more training in an effort to cut down on the number of students who are arrested.

The first interaction with a kid, Eslinger said, should rarely result in a citation; the goal should be building trust and positive relationships and, when possible, referring students to the principal.

“There is a difference between a student with a cellphone in the classroom and a student with a firearm,” Mayor Jackie Biskupski said. “Officers are in our schools to protect students — not to investigate them.”

As part of the promise to reform, representatives from the city, police department and school district signed a new agreement for security and training while standing in the hallways of one of the schools where officers have had the most trouble: West High.

The district was widely criticized after a 2010 police roundup of students there whom officers suspected of having gang affiliations. Between 14 and 40 teens — all of them black, Latino or Pacific Islander — were detained, questioned and falsely accused of being in gangs, according to a lawsuit filed by the American Civil Liberties Union.

That lawsuit ended in a settlement with a payout from police, an agreement to stop “gang sweeps” and a requirement for officers to undergo annual implicit bias training.

Even since then, the police department has continued to post more officers at schools on the west side and in areas with higher minority populations. Part of the contract is to staff officers at all middle and high schools, “not just those with certain characteristics,” said Biskupski, who has made this one of her top priorities before she leaves office.

The district will now have 11 resource officers — up from nine last year. Ten of those are armed Salt Lake City officers. One is an anti-gang educator in a youth program.

The three large public high schools in the district (East, West and Highland) will each have two officers throughout the day. The five middle schools will all have one. Previously, the two middle schools on the west side each had an officer while the three on the east side shared one, Eslinger said, and officers responded often to kids smoking or getting into fights.

Now he wants his force to play basketball with students at recess, read to them in the library and try to intervene when someone might be heading down a negative path. They should be like a counselor and a cop. And they should be there in case of a serious schoolwide threat, which occur maybe a half dozen times over the entire district in a year, Eslinger added.

The role of school resource officers has come under national scrutiny in recent years but particularly after one stationed at a Florida high school did not go inside last year when he heard gunshots. Seventeen people were killed while he waited by the door.

It touched off a debate about whether resource officers are effective or if, on a larger scale, they react too quickly to minor issues and arrest students too aggressively for crimes unrelated to possible attacks.

Zeia Woodruff is a senior at West High who sits on the executive committee for the Utah chapter of March for Our Lives, a student group urging gun reform after the deadly school shooting in Florida. She said she doesn’t want to see more officers patrolling schools but likes the softer approach this contract creates.

“We don’t want to support the militarization or more guns or more police officers pumped into schools,” Woodruff said. “There has to be relationship building. There has to be people who can talk to kids who might be causing trouble or posing a threat.”

On a national level, there are no training requirements to be a school resource officer. In Utah, after a bill passed in 2016, the state began requiring those officers to complete coursework on how to interact with students and when to intervene. The agreement in Salt Lake City adds another level of training.

“This is an important step to avoid criminalizing students,” said state Rep. Sandra Hollins, who sponsored that legislation three years ago.

As a result of that early initiative, Salt Lake City School District reported that the number of citations given to students decreased from 503 in the 2013-2014 school year to 112 in 2016-2017. Superintendent Lexi Cunningham said she’d like to see the numbers go even lower with more kids referred to peer court rather than getting a criminal record.

Cunningham said administrators should handle truancy issues and minor fights, not officers.

There are more than 23,000 students in the district, which has had Salt Lake City police patrols since the 1970s. The two agencies entered into a contract, though, only three years ago. This is the first major revision since then.

Eslinger said, over time, when he walks into a school, he hopes students will come up to him and say, “Good morning” rather than worry about why he’s there. Officers are the first line of defense and the first face many kids see walking to class every day.

“We are very dedicated to improving those relationships.”