INMATES at an Indonesian prison in Bali, which holds 12 Australians, have taken over the jail again after a second night of riots. Some 400 heavily armed police and military forces were gathered outside the overcrowded Kerobokan prison, which holds 1,000 inmates, including 12 Australians convicted of drug smuggling. "The prisoners took over the prison again, which forced security personnel to fire warning shots into the air," provincial military command spokesman Wing Handoko told AFP. "The rioters wanted their friends being treated in the hospital to be taken back because they were afraid they would be mistreated by security forces," he added. An AFP reporter heard three minutes of continuous gunfire, but it was not clear if there were any casualties. A flaming torch made of rags wrapped around a pole was flung from inside the prison and landed near a television vehicle, but was extinguished before the fire could spread. Riots continue in Kerobokan prison The prison was without light because electricity, cut off during Tuesday's rioting, still had not been restored by authorities. "There are 51 foreign prisoners from 17 countries at the prison. We will give them special security if the situation warrants," Handoko said before the shooting. It was not clear whether the most recent riot was close to the wing where Australian or other foreign prisoners are housed. Shouting and the rattling of the prison's inner gates were heard before police opened fire, but after the shooting silence and darkness descended upon the jail with inmates and security forces in a tense stand-off. Heavily armed forces had stormed the prison early Wednesday to regain control after inmates took over the prison during a night of arson and stone-throwing. All 12 Australian prisoners at Kerobokan, including two on death row and six serving life sentences, were safe after that trouble, Australia's foreign ministry said after Indonesian police had regained control of the facility. Some 100 heavily armed police and military had stormed the jail on the holiday island at around dawn on Wednesday, firing volleys of rubber bullets. Officials said they intervened after attempts to negotiate with the rioting prisoners had failed, and after some inmates managed to get hold of firearms. Three inmates had been injured in the legs, and a police officer was lightly hurt, police said. Among the Australians at the jail are convicted drug trafficker Schapelle Corby and a group known as the "Bali Nine", who were caught attempting to smuggle drugs from Bali. Up to 1,000 armed security forces backed by armoured vehicles and water cannon were stationed Wednesday morning outside the jail, which is in a suburban area of Bali seven kilometres from the tourism hub of Kuta beach. But police said the situation had returned to normal by late afternoon, and that only about 30 armed personnel had remained outside. Police and local reports said Tuesday's trouble began when one inmate stabbed another prisoner on Sunday, touching off reprisals that erupted into a full-blown riot. Prisoners began trashing cells and throwing stones at the guards who were forced to abandon the jail - built for just 300 inmates but now housing more than three times that many prisoners, both male and female. Police said the inmates were in charge for more than seven hours - from around 11pm Tuesday until 6.45am the following morning. Prison staff said the jail's registration office, including the files of prisoners, was destroyed in a blaze. After the rioting Tuesday, Michael Chan whose brother Andrew Chan is one of the Bali Nine, said he was worried about his brother given that during a previous riot "things got pretty bad, and they were in lockdown for a couple of days". Corby's family said she was well, with the women's wing of the prison untouched by the violence. There have been a number of riots at the jail in recent years, including one triggered by a police drug raid in June. It is one of Indonesia's most notorious prisons, with a combustible mix of inmates including convicted murderers, sex offenders and others guilty of violent crimes.