U.S. military personnel inspect each cell at the Camp 5 maximum-security facility on Guantanamo Bay, Cuba. (Brennan Linsley/AP)

Facing a potential showdown with Congress, the Pentagon is racing to move dozens of detainees out of Guantanamo Bay, Cuba, in coming months before lawmakers can block future transfers and derail President Obama’s plan to shutter the U.S. military prison.

As a first step, officials plan to send up to 10 prisoners overseas, possibly in June. In all, the Pentagon hopes that 57 inmates who are approved for transfer will be resettled by the end of 2015. That would require “large muscle movements” by at least two countries, which officials hope will each agree to take in 10 to 20 Yemeni detainees who, because of security conditions in their war-torn homeland, cannot be repatriated.

“I am aware of the clock ticking,” a defense official said, speaking on the condition of anonymity to discuss internal planning. “It’s going to take high-level leadership, and it’s going to take some big asks to some countries.”

The issue of what to do with those remaining detainees on trial in military commissions or who are deemed too dangerous to release also looms over a White House that is facing the end of Obama’s second term in 2017.

In the event that Congress does pass legislation that would freeze Guantanamo Bay’s population, currently at 122, White House officials are exploring options for the unilateral closure of the prison and moving detainees into the United States, an action that Congress has opposed from the president’s first months in office.

Officials said that Defense Secretary Ashton Carter, who has not approved any transfers since he took office in February, will sign off in coming weeks on the repatriation of inmates to Morocco and Mauritania, and the transfer of six Yemeni prisoners to a third country.

Forty-eight of the prisoners approved for transfer out of Guantanamo Bay are Yemeni. The last transfer was in January, when the United States sent four Yemenis to Oman and one to Estonia.

In addition, another prisoner who may be resettled as early as this summer is Shaker Aamer, an alleged al-Qaeda plotter and former U.K. resident whom British officials have lobbied Washington to release.

The growing sense of pressure will pose a test for Carter. The longtime Pentagon official took over responsibility for approving detainee transfers from his predecessor, Chuck Hagel, whose reluctance to approve the moves caused friction with the White House before he abruptly announced his resignation last year.

Carter, who promised at his confirmation hearing that he would play it “absolutely straight” in assessing Guantanamo Bay inmates, must navigate eagerness at the White House to reduce the prison’s population, worries among many uniformed officers about militants returning to the fight and opposition from many lawmakers to freeing inmates.

“He understands that he has to transfer people and that he wants to do ‘safe transfers,’ ” the defense official said. “So he’s trying to define what a safe transfer is.”

Debates about the safety of releasing detainees have held up transfers for years. One such detainee is Ahmed Ould Abdel al-Aziz, a Mauritanian who is expected to be repatriated as early as June. He was first scheduled for release in late 2009. Officials said more than a year ago that all the relevant U.S. agencies concurred that he should be transferred, but the defense secretary did not, frustrating some U.S. officials and detainee attorneys.

“It’s good that the administration is going to restart transfers, but these are ones that could have happened a long time ago,” said J. Wells Dixon, a lawyer with the Center for Constitutional Rights.

Said a second U.S. official, who spoke on the condition of anonymity to discuss internal deliberations: “Everybody said he should go back to Mauritania, including the intelligence community. The Pentagon has sat on it. The Pentagon raised concerns already addressed in an effort to forestall transfers.”

Sometimes officials raise flags about potential transfers during final evaluations that take place once a country has agreed to take in a prisoner. Aziz may have been one of those ­cases.

“We take very seriously the responsibility to ensure transfers are conducted safely and responsibly,” said Paul Lewis, Carter’s special envoy for closing Guantanamo Bay.

John Holland, an attorney for Aziz, said the news of his client’s release was long awaited. “We hope to God it is true,” he said.

Another detainee expected to be repatriated in June is Younis Abdurrahman Chekkouri, a Moroccan whom U.S. officials once described as a close associate of Osama bin Laden and a co-founder of the Moroccan Islamic Fighting Group, according to U.S. military files disclosed by the anti-
secrecy group WikiLeaks.

But officials have said that much of the information in some detainees’ files was inaccurate.

Chekkouri, 46, was cleared for transfer in January 2010, eight years after his capture. Neither he nor Aziz has been charged with a crime.

Chekkouri denies being part of a terrorist group in Morocco and says he would be tortured by the security services­ in his home country. The George W. Bush administration had previously resettled a dozen detainees in Morocco, including Chekkouri’s brother. Those transfers raised no concerns that would prevent Chekkouri’s return, officials said.

His attorney declined to comment.

A decision to send Aamer, one of the highest-profile prisoners who could be moved out of Guantanamo Bay, to Britain would be an important signal that the White House is willing to go ahead with transfers despite some officials’ fears about detainees’ future actions.

Some U.S. officials have worried about what Aamer, who was described in military files as an experienced al-Qaeda operative, might do once he is released. But after Prime Minister David Cameron, during a visit to Washington in January, pressed Obama to release Aamer, the president promised to prioritize the review of his case.

“We are confident that the U.S. government understands the seriousness of the U.K.’s request for Mr. Aamer’s release,” said a spokesman for the British Embassy in Washington.

The biggest challenge to Obama’s plan lies in Congress, where skeptical lawmakers are moving to tighten restrictions on sending prisoners overseas. In the Senate, Kelly Ayotte (R-N.H.) is sponsoring a bill that would extend the ban on bringing detainees to the United States and would effectively bar future transfers to third countries.

The White House is drafting a plan that officials hope will receive the support of Sen. John McCain (R-Ariz.) as an alternative to Ayotte’s measure. McCain, chairman of the Senate Armed Services Committee, has previously expressed openness to shutting the prison.

But it’s far from certain, even with McCain’s backing, that lawmakers would fall in behind the White House’s plan, which would allow detainees to be brought to the United States for trial or detention and would enable the continued transfer of others to foreign nations.

“It’s looking very difficult,” said Rep. Adam Smith (Wash.), the ranking Democrat on the House Armed Services Committee and a leading advocate for allowing prisoners to be brought to the United States. “I don’t see what changes­ minds or persuades people at this point,” he said. “But that’s what [the White House] is attempting to do.”

In the event that Congress does pass legislation that would freeze Guantanamo Bay’s population at 122, White House officials are exploring options for the unilateral closure of the prison.

Military prosecutors also are preparing to take steps that would shrink the number of detainees held without trial, by possibly charging up to six or seven more. They could include Riduan ­Isamuddin, better known as Hambali, the suspected mastermind of a bombing in Bali in 2002, as well two of his associates.

Julie Tate contributed to this report.