Three St. Louis police officers were charged on Thursday with beating up an apparent protester who turned out to be an undercover detective on their own team, the authorities said.

The officers were accused of attacking their own colleague during a September 2017 protest in response to the acquittal of Jason Stockley, a white police officer who killed a 24-year-old black man, Anthony Lamar Smith, after a high-speed chase. According to the federal grand jury indictment, the officers threw the detective to the ground, hitting and kicking him while using a riot baton.

Prosecutors obtained an indictment against a fourth officer on charges that she conspired to help the three cover up the beating.

The three officers accused of participating in the beating were charged with violating the constitutional rights of the detective, who the indictment identified only with the initials L.H. The indictment, submitted by the United States attorney’s office for the Eastern District of Missouri, said the officers used unreasonable force on the detective while he was not posing any threat.