The Obama administration on Thursday outlined how schools and colleges should manage relationships with police who work on their campuses, a move that comes in response to violent episodes that have stoked debate about whether law enforcement officers are keeping schools safe or arresting children for no good reason.

Police officers can be a force for good in a school by building strong relationships with students, Education Secretary John King said in a call with reporters Wednesday. But too often they become de facto disciplinarians leading to unnecessary citations and altercations. He pointed to the case last year in which a South Carolina sheriff’s deputy was filmed throwing a high school student out of her chair and across her classroom.

“The goal here is to give people a resource to do better,” King said.

In letters sent to schools nationwide, the Education and Justice departments said districts and colleges should make their expectations for school police clear by signing memoranda of understanding (MOUs) with local law enforcement agencies. Those MOUs should require training for officers working in schools and should explicitly say that their proper role is not to administer day-to-day discipline, the departments said.

The letters were accompanied by documents that laid out in greater detail how MOUs should work: They should require the public reporting of data on law enforcement activities inside schools, and should give schools a way to request the removal of a specific officer. They should also outline a regular process for reviewing and revising the MOU, and community members and civil rights organizations should have a say in that process.

The effort amounts to guidance from the federal government, which has little say in how and whether local school districts use law enforcement officers unless a civil rights complaint is filed, triggering a federal investigation.

But agencies will have to follow the guidance in order to qualify for federal grants that pay for the hiring of about 100 to 150 school resource officers each year, said Ronald L. Davis, director of the Justice Department’s Office of Community Oriented Policing Services.

The school police supported by those federal grants comprise a tiny minority of the 31,000 school resource officers working in public schools nationwide, according to federal data.

The effort to rethink the role of school police officers is consistent with the Obama administration’s broader push away from harsh zero-tolerance disciplinary policies that lead to high rates of suspension and expulsion.

“As educators, we are bound by a sacred trust to safeguard the well-being, safety, and extraordinary potential of the children and youth within the communities we serve,” King wrote in his letter Thursday. “In order to fulfill this trust, it is incumbent upon us to abolish the use of unnecessary school discipline practices that could deny students the opportunity to mature into capable, healthy, and responsible adults.”