At least 35 people have been killed and a further 50 injured after gang warfare sparked a riot in an Ecuadorian prison, reports from the country confirm.

The number of dead continues to rise as police check cells. Eight of the inmates killed were beheaded.

The two gangs inside Litoral Penitentiary, Guayaquil, allegedly have links to Mexican drug cartels and were armed with ‘firearms and explosives’.

Just two weeks ago, the prison service said that the prison was attacked by a drone as part of “a war between international cartels”.

They confirmed yesterday morning local time that: “An alert was activated for detonations of firearms and explosions in several pavilions, due to clashes between criminal gangs.”

Prison clash between gangs 'armed with explosives' leaves 24 dead, with 8 beheaded
It took authorities hours to regain control of the prison (Image: AFP via Getty Images)

Police said that the gangs were fighting for control of one of the prison’s pavilions well into the afternoon.

Thankfully, the National Police and Ecuadorian Armed Forces managed to regain control of the prison after a number of gruelling hours, confirmed Pablo Arosemena, the governor of the province of Guayas.

He wrote on Twitter: “I thank the National Police, the Armed Forces, the SNAI staff and all those who made it possible for us to restore order within the prison.

“It was not an easy task, but it is necessary to demonstrate with actions that there is a State here.”

He accompanied his message with footage of the prisoners lying on the ground, hands firmly on their heads after the situation had been neutralised.

Earlier, terrifying images taken by those nearby showed inmates on the prison roof wielding shotguns and machetes. In other videos on Twitter people could be seen desperately fleeing from the bloodshed.

According to local news network Teleamazonas, police are still continuing to check cells where the fighting occurred meaning that the death toll could still rise.

Prison clash between gangs 'armed with explosives' leaves 24 dead, with 8 beheaded
Police are still checking cells for more victims (Image: AFP via Getty Images)

One of the network’s reporters also confirmed on Twitter: “There are eight beheaded prisoners.”