El Salvador president Nayib Bukele ordered a 24-hour lockdown of prisons containing gang members, and said their leaders would be sent into solitary confinement after a sudden spike in homicides.

The remarkable announcement was made last Friday, after a series of grisly incidents were reported to have been organised from within prison walls.

"No contact with the outside world. Shops will remain closed and all activities are suspended until further notice," Mr Bukele tweeted shortly before midnight.

"Gang leaders will go into solitary confinement."

The president decreed "maximum emergency" after 22 homicides were carried out over a 24-hour period, the highest total in a single day since Mr Bukele took office last June, a police spokesman from El Salvador said.

Bukele ordered the emergency the day after more than twenty people were killed throughout country that authorities said were ordered from prisons. (El Salvador President Press Office via AP)

Pictures from inside the maximum security prisons where the lockdowns have occurred are striking, with armed guards wearing face masks patrolling a crowd of inmates, also in masks, who are packed tightly together in the prison's shared spaces.

El Salvador has long been plagued by powerful street gangs, known as maras, and has one of the highest known homicide rates in the Americas.

Murders have, however, fallen significantly under Mr Bukele, and the Central American country has in recent months registered several days without any homicides — no doubt a revealing statistic given the extreme punitive measures currently being carried out in maximum security prisons.

Police wearing masks as precautions against the new coronavirus guard inmates, also wearing masks, during a security operation. (El Salvador President Press Office via AP)

The country has also ordered some of the strictest measures in response to the coronavirus pandemic, having banned foreign travellers before the country had its first recorded case of COVID-19.

"How much would Italy give to be in our position and be able to declare a quarantine before having thousands of cases?" Mr Bukele said in March, when active cases were recorded as zero.

"We are facing a pandemic with an incredible virility that has probably never been seen before."