(CNN) Baton Rouge police Chief Carl Dabadie on Tuesday said officers have arrested three people they believe were planning to kill police in the Louisiana city.

The threat emerged after the shooting death of Alton Sterling last week by Baton Rouge police, which has prompted weeklong protests by people concerned about police use of deadly force.

The "credible threat" was why law officers were quick to take aggressive action when they believed protesters were becoming unruly, Debadie and other top law enforcement officers told reporters.

Riot police grab a protester after she refused to leave the road in Baton Rouge.

"We can't take anything for granted any more," said East Baton Rouge Sheriff Sid Gautreaux. "What you saw in the (law enforcement) response is because of the very real and viable threats against law enforcement. Look what happened in Dallas. A very peaceful protest and then some crazy madman."

Demonstrators march at the Louisiana Capitol on Saturday to protest the shooting of Alton Sterling.

Police said they learned of the plot when an officer responded to a burglary at Cash America Pawn early Saturday morning and arrested Antonio Thomas in the store, Debadie said.

Read More