President Obama is planning to transfer 17 or 18 detainees from the Guantanamo Bay military prison before his administration comes to a close in January.

The release of the detainees to Italy, Oman, Saudi Arabia, and the United Arab Emirates would mark the single largest transfer under the Obama administration. If the administration is successful, 41 or 42 prisoners would remain in Gitmo under President-elect Donald Trump, the New York Times reported.

Obama pledged to close down the Guantanamo Bay detention facility by the end of his presidency, calling the prison "contrary" to American values. Fifty-nine detainees remain in the prison of the 242 who were left to Obama by former President George W. Bush.

Though Obama will fail to shut the prison down before he leaves office, the president is attempting to move as many as possible of Guantanamo's 22 prisoners who are recommended for transfer.

The Pentagon by law must notify Congress at least 30 days before a transfer moves forward. The deadline before Obama's departure on Jan. 20 was Monday.

Trump has promised to keep the prison open and "load it up with some bad dudes." It is unclear whether the president-elect will refuse to transfer remaining detainees.

U.S. law bars the transfer of Guantanamo detainees to American soil, which a bipartisan majority in Congress supports keeping in place. Currently, Obama, Vice President Joe Biden, and Secretary of State John Kerry have to negotiate with foreign leaders to resettle or repatriate the detainees.