TEGUCIGALPA, Honduras (AP) — Inmates, some with firearms, rioted at a prison in Honduras on Friday, killing at least 18 people and injuring 16 others, authorities said.

The violence, which occurred in Tela in the Atlántida region on the Caribbean coast, came several days after Honduras declared a state of emergency in its prison system. The measure suspended civilian leaders in prisons and replaced them with a special commission led by military and police officers.

However, the transfer of control to the special commission had not been completed when the riot broke out at the Tela prison, said José Coello, a spokesman for the new prison command system.

Security forces quickly deployed to the prison to restore order and begin an investigation, Coello said.

The military and police takeover of prisons in Honduras is scheduled to last six months. Authorities want to use that time to root out corruption and violence in the prison system.