A riot has erupted at a crowded detention centre in Venezuela's capital Caracas, days before a controversial presidential election which is being seen as a test for the country's socialist revolution.

Videos from the prison, where many opponents of President Nicolas Maduro are held, showed groups of men identifying themselves as prisoners saying they had taken over.

Authorities in Venezuela have released no official information about the incident at the El Helicoide facility, located at the headquarters of the intelligence agency Sebin. But in a video which emerged from the prison, one man said: "This has been taken over peacefully by all the political prisoners and all the prisoners who are abducted here, who are tortured daily."

He added that tear gas and weapons had been fired at detainees but that prisoners were holding out and demanded freedom.

In another video posted on social media, US missionary Joshua Holt, from Utah, who is also being detained at the El Helicoide prison, pleaded for help.

"They have taken the entire prison where I am at. They are outside, they're trying to break in. They're saying that they want to kill me and that they want me as their guarantee," he said.

"I'm calling on the people of America, I need your help to get me out of this place. I have been begging my government for two years... and now my life is threatened. How long do I have to suffer here."

Mr Holt's family said the missionary was framed on weapons charges while in Venezuela for his wedding.

In another video posted on Twitter, Mr Holt appears with three other men believed to be other detainees. "I am here to show you that I am not being kidnapped. The only people who are kidnapping me is the government of Venezuela. We need the people to help us," he said.

Mr Holt said the men had been detained in the prison for four years without trial and that some of the prisoners were being denied medical attention. "They won't take us to the hospital, they won't help us," he said.

His mother Laurie Holt told Reuters that she did not know the sequence of the videos and was unable to confirm Mr Holt's current situation.

The riot was reportedly precipitated when political prisoner Gregory Sanabria was beaten as he tried to calm the situation inside the prison.

Chief prosecutor in Venezuela Tarek Saab said: "In the face of the events that happened today in the Sebin headquarters at the Helicoide, we sent a commission of the prosecutor's office to the facility. That delegation spoke to a representative of the prisoners to respond to their requests."

In a tweet, the US embassy said it was "very concerned" about the riot at the El Helicoide prison.

"Joshua Holt and other US citizens are in danger," it said. "The Venezuelan government is directly responsible for their safety, and we will hold you accountable if something happens to them," it added.

The Venezuelan government has refused to comment on the situation.

A turbulent year in Venezuela Show all 11 1 /11 A turbulent year in Venezuela A turbulent year in Venezuela Demonstrators scuffle with security forces during an opposition rally in Caracas, Venezuela, April 4, 2017. Venezuelan security forces quelled masked protesters with tear gas, water cannons and pepper spray in Caracas after blocking an opposition rally against socialist President Nicolas Maduro. The clashes began after authorities closed subway stations, set up checkpoints and cordoned off a square where opponents had planned their latest protest against the government and the crippling economic crisis. Carlos Garcia Rawlins: "For me that was the day that made a difference, never before had I seen the protesters and police clashing men-to-men and struggling back and forward. From then, the strategy of the police changed and they never faced the protesters so close again." Reuters A turbulent year in Venezuela A man who was set on fire by people accusing him of stealing during a rally against Venezuela's President Nicolas Maduro runs amidst opposition supporters in Caracas, Venezuela, May 20, 2017. Marco Bello: "I spotted a man running in front of me as a group of protesters, most of them hooded and with makeshift shields, were chasing him so I followed them. Some 100 meters down the street, the protesters caught the man and surrounded him. When I walked up and went through the circle of people to take pictures, someone had already poured gasoline over the man and set him on fire. Reuters A turbulent year in Venezuela "Rowdy groups of government supporters busted into Venezuela's opposition-controlled National Assembly. There were several clashes happening at the same time, so I tried to follow a small group of attackers as they pushed their way through the main building. By the time I got into the building, they had already finished hitting people and were on their way out, leaving behind an opposition lawmaker covered in blood. I quickly went over to the politician, Leonardo Regnault, whose grey suit was spattered in blood. He was up against an ornate wooden door, clearly in a state of shock. Another opposition lawmaker, Luis Stefanelli, was standing next to him, hands up in a sign of surrender and pleading with the attackers to stop the beating. Reuters A turbulent year in Venezuela A member of the riot security forces points a gun through the fence of an air force base at David Jose Vallenilla, who was fatally injured during clashes at a rally against Venezuelan President Nicolas Maduro's government in Caracas, Venezuela, Reuters A turbulent year in Venezuela A demonstrators attends a rally against Venezuela's President Nicolas Maduro's government in Caracas, Venezuela, June 19, 2017. Ivan Alvarado: "I was under the highway photographing some protestors who had surrounded a woman they accused of stealing a phone from someone. I turned around to check what was happening behind me and saw this man appearing from the shadows to see what was going on. The white on his face is salt, which the protestors said helped to reduce the effects of the tear gas." REUTERS A turbulent year in Venezuela Riot security forces clash with demonstrators as a motorcycle is set on fire during a protest against Venezuelan President Nicolas Maduro's government in San Cristobal, Venezuela, May 29, 2017. Carlos Eduardo Ramirez: "Security forces arrived to disperse demonstrators that already had burned two taxis and a bus, throwing tear gas and pellets and the demonstrators' response was to throw molotov cocktails and one of those petrol bombs reached a National Guard member, setting him and the motorbike on fire." Reuters A turbulent year in Venezuela Riot security forces detain a demonstrator during a rally against Venezuela's President Nicolas Maduro's government in Caracas, Venezuela, July 28, 2017. Rock-throwing Venezuelans braved tear gas and rainstorms, blocking streets in protest against a legislative super-body to be elected two days later that critics call an attempt by President Nicolas Maduro to create a dictatorship. Carlos Garcia Rawlins: "After many hours of very violent clashes between the demonstrators and security forces, the National Guard in an attempt to end the situation, suddenly advanced their line very quickly, even going beyond where I and other photographers were taking cover. All the protesters who did not react fast enough to leave the place were detained." Reuters A turbulent year in Venezuela Opposition lawmaker Carlos Paparoni is hit by jets of water during riots at a march to the state ombudsman's office in Caracas, Venezuela, May 29, 2017. A group of young Venezuelan lawmakers has risen to prominence on the violent front line of anti-government marches that have shaken the South American country for three months, bringing 75 deaths. On the streets daily leading demonstrators, pushing at security barricades and sometimes picking up teargas canisters to hurl back at police and soldiers, the energetic National Assembly members are heroes to many opposition supporters. Carlos Garcia Rawlins: "I remember clearly how instants after I spotted Paparoni standing in front of 'The Whale', the common name of the water cannon armoured cars, he was flying through the air due to the unstoppable power of the water, as if he was a feather. Fellow protesters had to drag him out of the place, because from where I was, he seemed to have been unconscious." Reuters A turbulent year in Venezuela Flames erupt as clashes break out while the Constituent Assembly election is being carried out in Caracas, Venezuela, July 30, 2017. Deadly protests rocked Venezuela as opposition voters boycotted an election for a constitutional super-body that unpopular leftist President Nicolas Maduro vowed would begin a 'new era of combat' in the crisis-stricken nation. Carlos Garcia Rawlins: "Suddenly, a bomb exploded in the capital during an opposition protest and wounded seven police officers in what seemed to be the spread of more aggressive tactics. We were taking photos from close by but the police panicked and chased everyone away, firing teargas, rubber bullets and pellets." Reuters A turbulent year in Venezuela An injured opposition supporter is helped by volunteer members of a primary care response team during clashes with riot security forces at a rally against Venezuelan President Nicolas Maduro's government in Caracas, Venezuela, June 22, 2017. Ivan Alvarado: "This image was taken next to an airforce base where another protestor was fatally injured that day. I don't know how this man was injured, I first saw him as the first aid volunteers carried him out from the midst of the tear gas. You can really see the pain in his expression as he cries out. After I took the image the motorbike speeded off down the highway." Reuters A turbulent year in Venezuela A demonstrator shouts slogans in front of police officers during a women's march to protest against President Nicolas Maduro's government in Caracas, Venezuela Reuters

Human rights groups and critics of President Maduro said several hundred political prisoners have been unfairly jailed. Mr Maduro previously said all jailed activists were being held on legitimate charges of violence and subversion.

The incident comes not long before Sunday's presidential election. The US, the EU, the UN Human Rights Council and neighbouring Latin American countries have expressed concerns about the upcoming poll and its vulnerability to manipulation.

Commentators say the election is the biggest test to the country's socialist revolution in nearly two decades amid a crisis-stricken economy. Mismanagement has been blamed for the erosion of the country's once-robust oil industry leaving widespread shortages of food and medicines.

President Maduro, 55, the successor to Hugo Chavez, is seeking re-election for a second term on behalf of PSUV (the United Socialist Party of Venezuela) after assuming office in 2013.

Outsiders have little doubt that Mr Maduro will win and he himself remains confident. "The revolution is going to record the biggest victory in its entire electoral history", Mr Maduro said in early May.

But opposition supporters say President Maduro cannot win the election without resorting to buying votes and coercion.

The main opposition, the Democratic Unity coalition, is boycotting the vote and has refused to enter any candidates.