(CNN) -- A Tunisian court has rejected a request to release Libya's former prime minister, who is set to be extradited back to his country, Tunisia's official news agency reported Wednesday.
Baghdadi Mahmoudi, Libya's premier under late strongman Moammar Gadhafi, was arrested in September for entering Tunisia illegally, though the decision to sentence him to six months in prison was later overturned on appeal.
He is the first high-level Libyan official set to be sent back for trial in the war-torn country, which had been embroiled in a bloody civil war that pushed the longtime leader from power in August.
Gadhafi was killed in October.
A Tunisian court decided Tuesday to extradite the former prime minister, a move considered beyond repeal.
His defense team, however, has argued that the lack of stability in Libya, with its fledgling legal institutions and detention centers that often leave detainees subject to mistreatment, means Mahmoudi cannot be processed fairly.
His lawyer, Mabrouk Kourchid, said that "Tunisia will be held accountable for any harm that will happen ... in case of extradition."
He added that Tunisia's interim president, Fouad Mebazaa, "has the power to refrain from signing the extradition."
Human Rights Watch has also called on Tunisia to halt the extradition to Libya, where the former premier is expected to face "a real risk of torture."
While the Libyan National Transitional Council has pledged to act fairly and root out abuse, "they do not have adequate control of security forces and of Libya's many detention facilities to guarantee al-Mahmoudi's safety," the group said in a statement Wednesday.
"Sending suspects to a country where there's a real risk of torture is prohibited under international law," said Joe Stork, deputy Middle East director at Human Rights Watch.
The group said it has documented recent cases of detainee abuse in the Libyan cities of Tripoli and Misrata, plus apparent executions of suspected Gadhafi supporters.
It is not clear when the extradition is scheduled to take place.