Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Guantánamo Bay prisoner has been transferred to his native Saudi Arabia where he will serve the rest of his 13-year sentence, the Pentagon announced on Wednesday, making him the first detainee to leave the controversial detention center since President Donald Trump took office.

Ahmed Mohammed Ahmed Haza al-Darbi pleaded guilty in 2014 to a 2002 Al Qaeda bomb attack on a French oil tanker off the coast of Yemen.

The Pentagon statement said that al-Darbi, who was originally scheduled to return home no later than Feb. 20 as part of a plea deal, has now complied with the terms of the deal and that he has waived his right to appeal.

This undated file photo provided by Ramzi Kassem, an attorney for Mohammed Ahmed Haza al-Darbi, shows al-Darbi inside the detention center at the U.S. base at Guantanamo Bay, Cuba. Ramzi Kassem via AP file

Before he was detained in 2002, al-Darbi worked for Abd al Rahim al-Nashiri, the mastermind of the USS Cole bombing in October 2000 that killed 17 U.S. sailors.

As part of his agreement, al-Darbi testified about Nashiri's role in the attack.

Saudi state security confirmed he had arrived back in the country just before midnight on Wednesday.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

His transfer brings the total number of men held at Guantánamo to 40. At its peak, the facility held 782 prisoners.

The agreement to repatriate al-Darbi was made under President Barack Obama, whose administration sought to gradually reduce the prison population in the hope of eventually closing the detention center.

Trump reversed that policy and has vowed to continue using the detention center, although no new detainee has arrived at Guantánamo since his election.

In a separate statement Wednesday, the Defense Department said it had sent the White House a proposed set of guidelines for sending prisoners to Guantánamo in the future "should that person present a continuing, significant threat to the security of the United States."

A Pentagon spokeswoman declined to provide any details about the new policy.

Al-Darbi is expected to serve out the rest of his sentence, about nine years, in a Saudi rehabilitation program for convicted extremists that aims to help them assimilate back into society through frequent visits with relatives, religious counseling with moderate clerics, art therapy and even cash assistance to help them once out.

Ramzi Kassem, a law professor at the City University of New York representing al-Darbi since 2008, said the transfer was the culmination of “16 long and painful years in captivity” for his client.

"While it may not make him whole, my hope is that repatriation at least marks the end of injustice for Ahmed," said Kassem.

In a statement released by Kassem, al-Darbi thanked his family for their patience and love.

"Looking at what lies ahead, I feel a mixture of excitement, disbelief, and fear. I've never been a father. I've been here at Guantánamo. I've never held my son," he said.

He also criticized the continued existence of the detention center.

“My words will not do justice to what I lived through in these years and to the men I leave behind in prison," he said. "No one should remain at Guantánamo without a trial. There is no justice in that."