Chile’s Chief of Police, Mario Rozas, resigned Thursday after cops shot two minors in an incident that sparked outrage across the country.

The South American nation is already alarmed at at the deployment of heavy-handed security force tactics during months of social protests.

In a statement, the President Sebastian Pinera said he had accepted the resignation of Mario Rozas, saying he shared “the reasons and arguments” he had given for resigning.

Police officers on Wednesday, shot and wounded two minors, aged 17 and 14, at a residence for troubled children and adolescents in the southern city of Talcahuano.

The officers had opened fire after they were attacked with sticks and stones at the center, run by the National Service for Minors, Police said.

Footage showed the teenagers writhing on the ground after they were shot in the legs.

Children’s Ombudsman Patricia Munoz denounced the police for using firearms “in an absolutely unjustified and excessive manner”.

“This situation is yet another manifestation of the horror of state violence exercised by those who, having the duty to protect children and adolescents, ultimately attack them in an unjustified and undue manner,” Munoz said.

The shooting was condemned by the Chilean branch of UNICEF.

“No situation justifies the use of firearms by the Carabineros to contain incidents involving minors, especially if they are under the protection of the state,” the UN Children’s organisation said.

Police second-in-command General Ricardo Yanez was appointed as Rozas’ replacement.

Anti-government protests in Chile that began in October 2019 and raged for months left over two dozen people dead and thousands injured.