Six inmates led by a mob boss committed suicide at a prison in Taiwan early Thursday after a failed breakout attempt in which they seized weapons and held a warden and guards hostage, officials said. All the hostages were released.

The inmates started their attempt Wednesday afternoon in the southern port city of Kaohsiung. In a telephone interview with a newspaper during the overnight standoff, the 46-year-old ringleader said the six had long planned the move and were prepared to die. He also complained about long sentences and unfairness in the granting of medical paroles.

Deputy Justice Minister Chen Ming-tang said officials rejected the group's demands for safe passage out of the prison and had tried to convince them to surrender peacefully during hours of negotiations.

"We tried to give them assurances so they wouldn't do something stupid and to reconsider, but sadly they committed suicide and we feel deep regret," Chen told a news conference in Taipei.

Chen said five prison staff were slightly injured in the standoff, but did not elaborate.

By the pre-dawn hours, the inmates had released all hostages except the warden. They then shot themselves, and the warden was able to walk free, Chen said.

The ministry did not offer any video or other evidence of the suicides, but there was no sign during the standoff of a raid by police who ringed the Kaohsiung Prison in scenes that were broadcast by Taiwan stations.

Chen said four of the inmates shot themselves first and that the remaining two had fired additional shots at them to make sure they were dead before shooting themselves, at about 5:30 a.m. Thursday.

On Wednesday afternoon, the inmates took four rifles, six handguns and more than 200 bullets from the prison's armory, the ministry said.

The inmates ranged in age from 37 to 63 and were serving sentences for homicide, burglary and drug crimes.

The ringleader, Cheng Li-te, was known as head of the Kaohsiung branch of the notorious mafia-type organization Bamboo Union and was serving a 28 ½-year sentence for homicide, the ministry said. The other five inmates were serving sentences ranging from 25 years to life.

They demanded safe passage from the prison while holding Warden Chen Shih-chih and head guard Wang Shih-tsang after the pair offered to swap themselves for earlier hostages.

Within hours of the hostage taking, armed police had surrounded the prison in the port city of Kaohsiung. Authorities also had called on relatives of the inmates to plea for the release of the hostages.

Chen said the inmates fired guns at about midnight to try to shoot down drone cameras deployed by media outlets and again at about 3 a.m. to warn off police.

The ministry said it had rejected demands that the police force be withdrawn and that two vehicles be provided to allow the prisoners to leave in exchange for the safety of the detainees.

The inmates used the need for medical care as a pretense to lure prison guards before kidnapping them, the official Central News Agency said.

The United Daily News said that in the phone call with Cheng, he also had complained about the tendency of judges to presume guilt, and to give long sentences to repeat offenders.

The ministry said Deputy Warden Lai Chen-jung and head guard Wang volunteered to swap with the two guards who were initially taken hostage. Later, Chen, the prison warden, offered to exchange with Lai as a hostage.