For Anthony Harris, 35, walking to the corner store to buy a soda in his hometown, Compton, Calif., often comes with the risk of being stopped and searched by the police. But when Mr. Harris and other members of a group of horse riders known as the “Compton Cowboys” choose to ride their horses to the store, something entirely different happens.

“They don’t pull us over or search us when we’re on the horses,” Mr. Harris said while riding a dark brown horse named Koda as two police cars slowly drove past him on a recent trip to the store. “They would have thought we were gangbangers and had guns or dope on us if we weren’t riding, but these horses protect us from all of that.”

The Compton Cowboys, composed of 10 friends who have known one another since childhood, but officially came together as a group in 2017 , are on a mission to combat negative stereotypes about African-Americans and the city of Compton through horseback riding.