The UK is to spend £25m on building a prison in Jamaica so that foreign criminals in the UK can be sent home to serve sentences in the Caribbean.
More than 600 Jamaican nationals are in UK jails but cannot be deported because of Jamaica's poor prison conditions.
Prime Minister David Cameron announced the deal as he began a visit there.
However, calls from Jamaican MPs and campaigners for Britain to pay reparations for its role in the slave trade threaten to overshadow his trip.
Jamaican Prime Minister Portia Simpson-Miller said she had raised the issue in talks, but Mr Cameron told reporters that financial reparations were "not the right approach".
The announcement of UK funding for a Jamaican prison aims to break a deadlock in negotiations over a prisoner transfer deal between the two countries.
Officials say the foreign aid-funded deal could save UK taxpayers £10m a year when transfers begin in 2020.
The average annual overall cost of a prison place in England and Wales for 2012-13 was about £36,000, according to National Offender Management Service accounts.
BBC political correspondent Carole Walker, who is travelling with Mr Cameron, says the PM has said he wants to improve a neglected relationship between the UK and Jamaica.
But she said "perhaps some eyebrows will be raised that the British foreign aid budget is being spent to build a prison in Jamaica".
The UK has committed to spending 0.7% of its GDP - about £12bn - on foreign aid, with its spending priorities focusing on health, education, water sanitation, the environment, economic growth, and promoting stable governance.
More than 300 existing offenders are expected to be sent back under the Jamaica prison scheme, which covers those sentenced to at least four years who have 18 months or more left to serve in custody.
Currently they cannot be sent to Jamaica because of fears that jail conditions in the country would allow a successful challenge under human rights law.
Jamaica is third highest in the list of foreign countries with nationals serving prison sentences in the UK. Almost 70% of the Jamaicans in prison in Britain are serving sentences for violence and drug offences.
The UK is contributing about 40% of the cost of building the planned jail, which would hold 1,500 people.
Mr Cameron, who is the first British prime minister to visit the island in 14 years, said it was "absolutely right" that foreign criminals were properly punished but not at the expense of the "hard-working British taxpayer".
He said the agreement would mean "Jamaican criminals are sent back home to serve their sentences, saving the British taxpayer millions of pounds but still ensuring justice is done".
However, Frances Crook from the Howard League for Penal Reform, said it was "the wrong use of foreign aid", and would not solve the problem of overcrowding in British prisons.
She added that without British support for the running of the new prison in Jamaica, it would "very quickly deteriorate", leaving the UK with the same problems that currently exist.
Mr Cameron is also set to announce £300m of aid funding on infrastructure projects across the Caribbean, including roads, bridges and ports.
He was greeted on his arrival at Kingston Airport by an honour guard and national anthems before he visited RFA Lyme Bay, the British ship currently on anti-drug smuggling and emergency relief duties in the Caribbean.
The Jamaican PM gave Mr Cameron a warm welcome, hugging and kissing him on both cheeks - but the issue of whether the UK should pay reparations to Caribbean countries for its role in the slave trade has threatened to cast a shadow over the visit.
The Caricom reparations committee, which was set up by Caribbean nations to lobby for compensation, also wants an apology from the British government.
Ms Simpson Miller said she had raised the controversial question during one-to-one talks with the PM at her official residence in Kingston.
She said she told him that while she was "aware of the obvious sensitivities", Jamaica was "involved in a process under the auspices of the Caribbean community to engage the UK on the matter".
One politician, Mike Henry, has urged colleagues to turn their backs on Mr Cameron when he addresses the Jamaican parliament unless he puts the issue on his agenda.
Mr Cameron made no mention of the issue after the talks - but Number 10 said he had made clear to his opposite number that he "understood it was an issue for some people".
However he "reiterated the long-standing position of the United Kingdom that we do not believe reparations is the right approach".