U.S. President Barack Obama and Uruguay President Jose Mujica Cordano speak to the press before a meeting in the Oval Office of the White House May 12, 2014 in Washington. (Brendan Smialowski/AFP/Getty Images)

Uruguayan President José Mujica said Thursday that his nation is willing to accept six detainees from the U.S. prison at Guantanamo Bay, Cuba — one of the largest groups of Arab detainees to be released to a third country.

But the Obama administration should move fast, Mujica said.

“It can’t be too long,” he said in an interview. “I only have a few months of government left.”

The Obama administration has long pledged to close the 12-year-old military facility, which has been assailed by human rights groups for its prolonged detention of suspects without charge. U.S. officials have struggled to resettle or repatriate prisoners, but Mujica quickly agreed to a request about four months ago to take some inmates.

The men whom Uruguay would accept are among a group that has been especially difficult to move — Arabs who have been cleared for release but can’t return to their nations, either because of war, fear of torture or security concerns about their home countries. The offer could free the last four Syrian detainees at Guantanamo Bay, along with a Palestinian and a Tunisian.

Human rights activists said they hope the offer will spur other nations to open their doors to more of the 154 prisoners remaining at Guantanamo Bay. “This Uruguay deal is the kind of momentum other countries need to see,” said Andrea Prasow, who follows detainee issues for Human Rights Watch.

Mujica, 78, a former urban guerrilla, has become well known for the liberal causes he has championed in his country of 3 million people — from recognizing same-sex marriage to legalizing the sale of small quantities of marijuana.

“I always thought it was really good that Obama wanted to resolve this,” Mujica said. He called the Guantanamo Bay prison a disgrace for the United States, “which on the one hand wants to wave the flag of human rights, and assumes the right to criticize the whole world, and then has this well of shame.”

But there was a personal element to his decision, too. Mujica spent more than 13 years behind bars as a young man for his guerrilla activities, much of it in solitary confinement under a military dictatorship. “I know prisons from the inside,” he said.

He recalled that his only companions during many of those years were mice, ants and spiders. At one point, he befriended a tiny frog in his cell, providing it a cup of water in which to swim. “When you have a lot of solitude, any living thing becomes a companion,” he said.

When the U.S. ambassador to Uruguay asked him to accept detainees, he said, he immediately accepted. Mujica added that he did not bargain for anything in exchange for taking detainees from Guantanamo Bay.

But moving the prisoners is not so simple. Although the U.S. government has approved their release, the State and Defense departments have to agree to their relocation to a new country. Among other things, they have to ensure that the receiving nation will take steps to prevent the transferred detainees from becoming a security threat.

Mujica said that the prisoners will be considered normal refugees, and that his government does not intend to monitor them. “We are not the jailers of the United States government, or the United States Senate,” he said. “We are offering solidarity on a question that we see as one of human rights.”

Prasow, of Human Rights Watch, said some countries that have received detainees have restricted their travel, but others have not.

President Obama met with Mujica in the Oval Office on Monday and praised his “extraordinary credibility when it comes to issues of democracy and human rights.”

Asked whether the Guantanamo Bay offer had come up in that meeting, Mujica said: “We have nothing to discuss. It’s your problem. We have made our decision” to accept the detainees. Mujica’s successor will be chosen in elections in October, and Mujica will leave office in March.

Lt. Col. J. Todd Breasseale, a Pentagon spokesman, said in an e-mail that the department does not discuss any detainee transfers before they occur. Clifford Sloan, who heads the State Department’s Office of Guantanamo Closure, also declined to talk about the particulars of Uruguay’s offer. But he added that “we are reaching out to a range of countries” to take in detainees and said “we are very pleased by the support we are receiving.”

Uruguay would become the first country in South America to accept detainees from Guantanamo.

A total of 11 Syrians have been detained at Guantanamo Bay since it opened, but several have been resettled in other countries. One of those remaining, Ali Hussein al-Shaaban, 31, has spent 12 years at the prison. His attorney, Michael Mone, said he was not allowed to confirm whether Shaaban was part of the Uruguay deal. But he said Shaaban had been reading about Uruguay in an encyclopedia at the camp, and is learning Spanish.

“He would be so grateful to the government and people of Uruguay” if he could be moved to the South American country, said the lawyer, adding that his client “has no interest in traveling anywhere” once he is resettled.

Julie Tate contributed to this report.