Images of prison raids in El Salvador in which officers drag half-naked inmates out of their cells, force them to run and search them in the courtyard.

El Salvador prisoners dragged out of cells amid spike in gang violence

El Salvador's President Nayib Bukele issued an ultimatum Monday to gangs considered responsible for dozens of homicides in three days, threatening to increase punishments on their more than 16,000 imprisoned members.

The Central American nation declared a state of emergency Sunday as it endures a fresh wave of gang violence, with police reporting 87 dead since Friday.

"Stop killing now or they (the incarcerated) are going to pay for it too," Bukele tweeted, alongside video footage of a prison raid in which officers drag half-naked inmates out of their cells, forcing them to run and search them in the courtyard.

The images also show officers rushing the inmates, who are handcuffed and wear only white boxer shorts. Some of them fall as they are forced along.

Hundreds are also filmed kneeling, in a row.

Bukele's reaction comes the day after lawmakers declared the state of emergency at his request, expanding police powers and curtailing civil liberties.

The homicides were allegedly ordered by the Mara Salvatrucha (MS-13) and Barrio 18 gangs.

"We have 16,000 'homeboys' in our power, apart from the 1,000 arrested" in recent days, Bukele said Monday.

He had also decreed a "maximum emergency" in all prisons since Sunday. Incarcerated gang members have been subjected to strict measures, including permanent confinement to their cells.

"We confiscated everything, even their sleeping mats, we also rationed their food and now they will no longer see the sun," Bukele said.

The president's decision was slammed by the former executive secretary of the Inter-American Commission on Human Rights (IACHR), Paulo Abrao.

"Criminal populism: illegalities to confront illegalities. Barbarities to confront barbarities," he wrote on Twitter.

Bukele immediately responded: "You at the OAS (Organization of American States) and the IACHR were the ones who sponsored the truce that only strengthened the gangs and allowed them to accumulate resources, money, weaponry."

He was referring to the 2012 gang truce facilitated by then-president Mauricio Funes and backed by the OAS in order to reduce homicides.

There are about 70,000 members of the MS-13, Barrio 18 and other gangs in El Salvador. Their operations involve homicides, extortion and drug trafficking, according to authorities.