JAKARTA, Indonesia — A deadly riot involving terrorism suspects inside a high-security detention center outside Indonesia’s capital stretched into Wednesday evening, officials said, and the media arm of the Islamic State claimed its loyalists were holding hostages there.

The police said that five guards and one detainee had been killed in the riot.

Gen. Mohammad Iqbal, a National Police spokesman, told reporters that the riot erupted late Tuesday at the detention center, which is inside the local headquarters of the National Police Mobile Brigade, a paramilitary police unit, in Depok, West Java Province. He said at least six detainees were still holed up within the compound.

“We’re still negotiating with them, we’re still talking to them,” he said.

General Iqbal said that the riot had started in the section of the detention center reserved for terrorist suspects and convicted terrorists. .

“We have isolated them into one block, so the situation is under control,” General Iqbal said. He added that they were working to negotiate the release of one police officer being held hostage.

Even as the riot was unfolding, the Islamic State’s propaganda arm uploaded videos and photos that they claimed were from inside the detention center, showing executed hostages and detainees brandishing weapons, raising the black flag of the Islamic State and pledging allegiance to the group’s leader.

General Iqbal denied the Islamic State was behind the riot. “The trigger is trivial: complaints about food,” he said.

There was a riot at the same police detention center in November 2017, when terrorist detainees fought with guards during a search for contraband, including cellphones. They took photos and video of themselves brandishing Islamic State flags.

On Wednesday evening, police officers wearing flak jackets and helmets and carrying assault rifles were still surrounding the compound, which lies about 15 miles south of Jakarta, the capital.

Nearly 150 detainees awaiting trial on terrorism charges, as well as convicts awaiting transfer to prison — most of whom are linked to the Islamic State — are among those held in the detention center, according to the Institute for Policy Analysis of Conflict, a Jakarta-based research organization.

In a report released in February, the institute called the concentration of so many Islamic State supporters at the detention center “a disaster waiting to happen.”

“We said it was A: overcrowded, and B: there was no effort at all to counsel the newly arrived detainees, and they were almost all pro-ISIS,” said Sidney Jones, the institute’s director.

Ms. Jones, a prominent terrorism analyst, said the November 2017 riot was a warning to the authorities, who then began moving the most violent or radicalized convicts on terrorism charges to the maximum security prison island of Nusakambangan, off the south coast of Java Island.

The biggest attack by pro-ISIS Indonesian militants here came in January 2016, when a group of four men attacked a police post and shopping center in downtown Jakarta with homemade guns, bombs and suicide vests. The four attackers were killed along with four civilians, and 23 people were injured.

Last week, the police in West Java arrested three men who were accused of planning a suicide bomb attack on the Police Headquarters where the detention center is.