The UK plans to spend £25m in foreign aid to build a prison in Jamaica to enable about 300 Jamaican nationals currently serving sentences in UK jails to complete their incarceration in their home country.

There are more than 600 Jamaicans in UK jails as of June this year, but only 300 offenders are expected to be sent back under the prisoner transfer scheme which covers those who have been sentenced to at least four years and have 18 months or more left to serve.

The UK has similar prisoner transfer deals with Albania, Nigeria, Somaliland, Rwanda and Libya

Jamaica is the third highest in the list of foreign nationals serving prison sentences in the UK. Almost 70% of the Jamaican prisoners are serving sentences for violence and drug offences.

According to the Jamaica Observer, at least 2,309 Jamaicans are in jails in 10 countries across the world, which has posed a dilemma to the Jamaican government on how much effort, time and money it should spend to represent them.

The deal was announced by UK Prime Minister David Cameron during his visit to the Caribbean, the BBC reports. The move was aimed at breaking the deadlock in talks over a compulsory prisoner transfer deal between the two countries. The UK will contribute about 40% of the cost of building the proposed jail which will have a capacity of 1.500 prisoners.

Jamaican nationals serving jail sentences in the UK cannot be deported because of fears that the country's poor prison conditions would allow a successful challenge under human rights law.

Officials say the prison deal could save taxpayers £10m a year when the prisoner transfers start in 2020.

Cameron said in Jamaica: "It is absolutely right that foreign criminals who break our laws are properly punished but this shouldn't be at the expense of the hard-working British taxpayer. That's why this agreement is so important.

"It will mean Jamaican criminals are sent back home to serve their sentences, saving the British taxpayer millions of pounds but still ensuring justice is done. And it will help Jamaica by helping to provide a new prison, strengthening their criminal justice system," Cameron added.

The Guardian said the deal is the culmination of almost a decade of negotiations between both governments. It said the prisoner transfer deal could still be challenged under human rights laws by Jamaican prisoners who have family ties in the UK and do not wish to return to their home country.

First visit in 14 years by UK prime minister

Cameron is the first UK prime minister to visit the island in 14 years. Former premier Tony Blair made an official visit to Jamaica in 2001.

As part of his visit, Cameron also announced a £300m aid package for infrastructure projects for Jamaica, Guyana, Belize, Dominic, Grenada, St Lucia, Antigua and Barbuda, St Vincent and the Grenadines and Montserrat.