Police officers stand guard outside Kaohsiung Prison, southern Taiwan, February 11, 2015.
Police officers stand guard outside Kaohsiung Prison, southern Taiwan, February 11, 2015.Reuters

Six inmates who held a warden and a guard hostage inside a prison in Taiwan ended the hours-long stand-off by shooting themselves early on Thursday after releasing the hostages unharmed, officials said.

The armed prisoners committed suicide following a shootout with police at Kaohsiung Prison in southern Taiwan.

The concerned inmates had been convicted of various crimes such as murder, drug-related offences and burglary among others, the BBC repots.

According to Taiwanese media reports, the prisoners were protesting against their sentences, unfair trials and alleged mistreatment.

First, four of the six inmates shot themselves from the guns they had seized from the prison cache. The other two added several shots to the four prisoners to make sure that they were dead before shooting themselves to end the 14-hour drama inside the prison, said Chen Chia-hsin - head of Koahsiung Police Department, according to South China Morning Post.

President Ma Ying-jeou of Taiwan condemned the actions of the hostages terming them as unacceptable. He, however, expressed condolences to the family members of the inmates who took their own lives, Chinese media reported.

It all started when the prisoners feigned illness to lure two guards inside their cells at about 4:40 p.m. local time on Wednesday, only to take them as hostage, Taiwan's Central News Agency stated.

They forced the guards to take them into the prison's weapons store from where they stole four rifles, six handguns and around 200 bullets. After police surrounded the prisoners, a negotiation was struck whereby the guards were exchanged with the prison warden and the head guard.

They then asked for a getaway car, which the officials rejected. At one point, they tried making their way out but police gunfire forced them to retreat. After the night-long hostage situation, the head guard was finally released at around 3 a.m., while the prison warden was released unharmed two hours later.

Moments later, the inmates killed themselves.