When University of Cincinnati police officer Ray Tensing was charged with murder today for shooting Samuel DuBose during a traffic stop, the prosecutor in the case had harsh words for university police in general.

"I don't think a university should be in the policing business," said Joe Deters, the Hamilton County prosecutor, saying he thinks the city should handle it.

But nearly all universities are in the policing business. Almost all four-year colleges with more than 2,500 students had their own law enforcement agency during the 2011-'12 academic year, according to a survey from the Bureau of Justice Statistics. Most of those officers can carry and use guns. In some cases, they have jurisdiction outside campus boundaries for traffic stops, such as the stop that ended with DuBose's murder on July 19.

The first campus police department was established more than a century ago at Yale. But they didn't become widespread and fully professionalized until the 1960s, when colleges shaken by protest decided that it was both politically and tactically smarter to have their own police instead of relying on local forces.

How 1960s protests created campus police

Colleges have always had crime: "violence and vandalism and all the various things that happen when you put a bunch of relatively young people together in a relatively small space," said John J. Sloan III, a professor of criminology and sociology at the University of Alabama Birmingham who studies campus crime.

But well into the 20th century, campus security at many colleges wasn't anyone's full-time job. It was a patched-together system of professors, administrators, and watchmen and maintenance workers.

The exception was Yale, where two police officers from New Haven were assigned to campus in 1894. The official origin story is that rumors that Yale medical students were stealing cadavers from New Haven graveyards had led to violence and riots in New Haven. But this is quite possibly apocryphal; there's no record of such a riot in 1894, and New Haven's violent riots over body-snatching actually occurred 70 years earlier.

But Yale's police weren't full-time, and few universities followed their lead, Sloan said. In the 1960s, though, local police were increasingly called to campuses to deal with student protests. Those encounters often turned violent.

College presidents began to lobby state legislatures for the right to create their own police departments, where officers would have a constant presence and become part of the campus community rather than being seen as "some kind of invading army" when something went wrong, Sloan said.

"It doesn't look good to have county sheriffs or local police officers patrolling the campus," he said. "It’s far better to have your own department, your own officers who can be trained appropriately, because this is somewhat of a different setting."

They succeeded: At least 44 states now have laws allowing colleges to form their own police force. Virtually all public colleges with more than 2,500 students, as well 91 percent of private colleges of that size, have done so.

The powers of campus police extend beyond campus

As in Cincinnati, where Tensing shot Dubose outside of the university campus, it's not uncommon for campus police to patrol and make arrests outside colleges' boundaries.

The Bureau of Justice Statistics survey found that campus police officers had patrol and arrest jurisdictions in areas next to campuses at 81 percent of colleges. And 70 percent of colleges had agreements with other local authorities that defined their jurisdiction beyond the college itself.

Joint training in those situations is key, Sloan said, so that city police and campus police are instructed to react the same way to the same situation.

Campus police more often face protests for how they treat students: One of the biggest controversies surrounding campus police in recent years was about a University of California Davis police officer who pepper-sprayed a protestor in 2011.

But campus police also have their share of shootings, and most campus police officers involved in shootings, like most police officers in general, haven't been indicted. At San Jose University, a campus police officer who shot a man holding a saw in February 2014 wasn't charged; the man's family has sued the college. A campus police officer at the University of the Incarnate Word, a private Catholic university in San Antonio, fatally shot 23-year-old Cameron Redus in the back in December 2013; a grand jury didn't indict the officer, and Redus's family has filed a wrongful death lawsuit.

Campus police officers generally undergo the same training as city police, Sloan said. That means they also have the same problems as police departments off campus.

"The single biggest thing that is happening now with the police is there must be better training in how to, number one, deal with people and, number two, defuse situations," Sloan said — an issue he said applies to "campus police officers, city police officers, county sheriffs, transit police, port authority police."