A soldier stands guard in a tower overlooking Camp Delta at Guantanamo Bay Naval Base in a December 31, 2009 photo courtesy of the US Navy.

US Navy | Reuters

The Pentagon said Monday it had returned a Moroccan citizen from Guantanamo Bay to his home country, the first such release under President Joe Biden, who has vowed to close the prison facility.

The transfer of Abdullatif Nasser to Morocco left 39 prisoners in the island prison off the east coast of Cuba. His transfer follows a panel decision in 2016 that found that the alleged former al-Qaida member no longer needs to be detained by the US in order to protect US national security.

Nasser’s lawyer hailed his transfer.

“This is a hugely welcome event. I am still shocked about it,” said attorney Shelby Sullivan-Bennis in a brief telephone interview.

The release of Nasser, in his 50s, reflects the ping-ponging of presidential policy in Guantanamo Bay.

President George W. Bush established the detention center in 2002 after the September 11, 2001 terrorist attacks. Nearly 800 people were arrested at one point or another on the premises.

When the prison camp became known for torture and other human rights abuses, former President Barack Obama tried to close it down. Obama’s failure to do so has become one of the administration’s most notable unfulfilled promises.

“I’m so happy that the promises made by the Biden administration have come true while those of the Obama administration have not been fulfilled,” said Sullivan-Bennis.

Obama’s successor, former President Donald Trump, reversed the Obama-era government stance and issued an executive order to keep Guantanamo open. Only one prisoner was transferred under Trump.

Nasser, whose name is also transcribed as Abdul Latif Nasir, had been imprisoned in Guantanamo since 2002. While a government body known as the Periodic Review Board recommended in 2016 that he be transferred to Morocco subject to certain assurances regarding safety and humane treatment, the process under Obama could not be completed, the Pentagon said.

The Pentagon did not say whether Nasser will be arrested in Morocco. He was not immediately available for comment from his attorney. The Associated Press reported that police arrested him after he arrived in Morocco and said they were investigating him on suspicion of terrorist acts – although he was never charged in Guantanamo.

Sullivan-Bennis said she understood that her client was briefly detained in Morocco and then allowed to go home within an hour.

“Amazingly on time for Eid,” she said in a written message, referring to the Muslim religious holiday that began Monday evening.

“The United States commends the Kingdom of Morocco for its longstanding partnership in safeguarding the national security interests of both countries,” said a statement from the Defense Department. “The United States is also extremely grateful for the willingness of the Kingdom to support the ongoing US efforts to close the Guantanamo Bay Detention Center.”

The Justice Department declined to comment.

—The Associated Press contributed to this report.

Correction: An earlier version incorrectly reproduced Trump’s view of Guantanamo in a reference.

Subscribe to CNBC Pro for the TV livestream, deep insights and analysis to invest.