President Jose Mujica of Uruguay has said his country will take five prisoners from the Guantanamo Bay detention centre in Cuba.
Mr Mujica said he had agreed to a request from President Barack Obama to take some of the detainees remaining at the controversial US military camp.
He added that the five inmates would be welcome to "work and stay with their families in Uruguay".
President Obama has pledged to free all remaining inmates and close the camp.
There are 154 detainees remaining in the camp, most of them from Yemen.
'They are welcome'
"The US president wants to solve this problem so he's asking several countries to host them and I told him I will," Mr Mujica told local media.
"They are welcome to come here."
The US embassy in the Uruguayan capital, Montevideo, said Washington was "dealing with different countries in the region" and approached Mr Mujica because of his "leadership" in Latin America.
A former guerrilla member, the Uruguayan president spent nearly 15 years in prison during the military government of the 1970s and '80s in the South American country.
He said he had accepted the US request "for human rights reasons".
President Obama has said the prison has damaged America's standing in the world.
Transfers out of Guantanamo to third countries have increased in recent months.
But the US leader's plan to close it has been thwarted in part by Congress.
In the past, the US raised concerns of possible mistreatment if the detainees were sent back to their home countries.
Guantanamo has been criticised by human rights groups.
Most of the inmates there have never been charged or tried for any crime.
The detention facility was opened by former US President George W Bush to hold terrorism suspects rounded up overseas following the 11 September 2001 attacks.