Slave patrols
There are two historical narratives about the origins of American law enforcement.

Policing in southern slave-holding states had roots in slave patrols, squadrons made up of white volunteers empowered to use vigilante tactics to enforce laws related to slavery. They located and returned enslaved people who had escaped, crushed uprisings led by enslaved people and punished enslaved workers found or believed to have violated plantation rules.

The first slave patrols arose in South Carolina in the early 1700s. As University of Georgia social work professor Michael A. Robinson has written, by the time John Adams became the second U.S. president, every state that had not yet abolished slavery had them.

Members of slave patrols could forcefully enter anyone’s home, regardless of their race or ethnicity, based on suspicions that they were sheltering people who had escaped bondage.

The more commonly known precursors to modern law enforcement were centralized municipal police departments that began to form in the early 19th century, beginning in Boston and soon cropping up in New York City, Albany, Chicago, Philadelphia and elsewhere.
The first police forces were overwhelmingly white, male and more focused on responding to disorder than crime.

As Eastern Kentucky University criminologist Gary Potter explains, officers were expected to control a “dangerous underclass” that included African Americans, immigrants and the poor. Through the early 20th century, there were few standards for hiring or training officers.

Police corruption and violence – particularly against vulnerable people — were commonplace during the early 1900s. Additionally, the few African Americans who joined police forces were often assigned to black neighborhoods and faced discrimination on the job. In my opinion, these factors — controlling disorder, lack of adequate police training, lack of nonwhite officers and slave patrol origins — are among the forerunners of modern-day police brutality against African Americans.
https://archive.fo/qL3Pp#selection-1603.0-1693.84