President Shimon Peres on Thursday granted an early release on humanitarian grounds to security prisoner Mohammed al-Taj, a terminally ill hunger striker.

The decision was based on the recommendation of Justice Minister Tzipi Livni and accepted by defense officials. It came three weeks after the death from cancer of a Palestinian prisoner in an Israeli jail sparked days of West Bank riots.

“The decision to release [Taj] was taken on humanitarian grounds as the prisoner was ill with a serious medical condition,” a statement from Peres’s office said. It gave no further details.

Taj, 40, has served 10 years of a 14-year sentence for terrorist activities.

In February, he was rushed to Meir Hospital in Kfar Saba after his health condition had seriously deteriorated, where, according to his lawyer, doctors called Taj’s condition “hopeless.” He has been on a hunger strike since March 2012, along with a number of other detainees agitating for better conditions and an end to administrative detention.

Since being released from Meir Hospital, Taj has been at the Israel Prison Service Medical Center. He is to be transferred to the government hospital in Ramallah upon his release.

Three weeks ago, the death of Maysara Abuhamdia sparked several days of West Bank clashes. Abuhamdia, 64, who was serving a life sentence for orchestrating what was ultimately a failed suicide-bombing of a Jerusalem cafe in 2002, died of cancer. The Palestinian Authority accused Israel of not providing appropriate medical aid to the prisoner, a charge Israel denied.

The Associated Press contributed to this report.