WASHINGTON — The Pentagon has transferred a Guantánamo Bay prisoner to the custody of Saudi Arabia, a spokeswoman announced on Wednesday. The handoff is the first time a detainee has left the wartime prison under President Trump, who vowed to fill it back up but has now instead overseen a reduction in its population.

The prisoner, Ahmed Muhammed Haza al-Darbi, is unlikely to be set free soon. American officials intend for him to serve the roughly nine years remaining in a 13-year sentence he received after pleading guilty before a military commission to terrorism-related offenses involving a 2002 Qaeda attack on a French-flagged oil tanker off Yemen’s coast.

“My words will not do justice to what I lived through in these years and to the men I leave behind in prison,” Mr. Darbi said in a statement provided through his volunteer lawyer, Ramzi Kassem, a law professor at the City University of New York. “No one should remain at Guantánamo without a trial. There is no justice in that.”

Mr. Darbi’s departure leaves 40 detainees at Guantánamo, down from 41 when President Barack Obama left office. The transfer comes as the Trump administration has been struggling to fulfill the president’s strong desire to back up his chest-thumping campaign rhetoric about Guantánamo, even as counterterrorism and security professionals, including Defense Secretary Jim Mattis, have repeatedly argued that other approaches made more practical sense.