At least five people have been killed in violent riots at a jail in western Indonesia and about 100 prisoners, including terror convicts, are still on the loose, police said Friday.

"Three are prisoners, two are prison staff," said Heru Prakoso, North Sumatra province police spokesman, adding they died in fires at the facility.

Security forces were still struggling to regain control of the prison in Medan city on Sumatra island on Friday after riots erupted the previous day.

Around 150 people escaped during the unrest at the Tanjung Gusta prison, he said.

Inmates set the jail on fire after becoming angry at power cuts and water shortages at the prison.

Prakoso said around 55 prisoners who had escaped had been recaptured, including three terror convicts.

However, around 100 prisoners were still on the loose, including six terror convicts, he said.

The prison had been holding a total of 11 terror convicts. Some of them had been involved in militant training in Aceh province, on the northern tip of Sumatra, while others were involved in a bank robbery, he said.