WASHINGTON (AP) — The Supreme Court has cleared the way for the United States to send two Guantánamo Bay detainees back to Algeria even though they want to remain at the prison because they fear they might be tortured in their home country.

The court on Saturday declined to hear the appeal of Aziz Abdul Naji, who was captured in Pakistan and has been held since 2002 at Guantánamo, in Cuba.

That ruling came after the court’s decision late Friday that allowed the federal government to proceed in transferring another Algerian detainee, Farhi Saeed bin Mohammed, back home.

Both detainees had argued they would be harmed by the Algerian government or unaffiliated Islamic militants if they were released.

They are among six Algerian detainees at Guantánamo who say they would rather remain at the prison than return to their home country, where political turmoil has claimed thousands of lives in recent years.

A federal judge this year initially barred the government from repatriating one of the detainees to Algeria until there were more assurances that he would be treated humanely.

An appeals court overturned that order.

On Friday, the Supreme Court — with Justices Ruth Bader Ginsburg, Stephen Breyer and Sonia Sotomayor dissenting — upheld the decision of the appeals court in saying that the detainee should be sent back.

The federal government said it had assurances that the Algerian detainees would not be abused.

A Pentagon spokeswoman, Maj. Tanya Bradsher, said on Saturday that her department had no comment on when the detainees might be transferred.