High Court Judge Nicholas Madge has now ruled that Aliou Bah was kept in prison for 21 months longer than he should have been and is due £110,000 in compensation

A migrant jailed twice for sex attacks has won £110,000 compensation for being locked up too long – after his own country refused to take him back.

The judge who awarded the money admitted he ‘wholeheartedly’ agreed that many would think it was the victims of 28-year-old Aliou Bah who deserved large payouts instead.

Bah, from Guinea, had been imprisoned twice for serious assaults – including an attack on a 16-year-old girl – and placed on the sex offenders’ register.

But in a ruling revealed yesterday, a court decided that the Government had held him unlawfully for 21 months when there was no reasonable prospect of deporting him to West Africa.

Moves to throw him out were blocked by immigration officials in his homeland who refused to process his travel documents.

Another obstacle to deportation was that Bah had been granted permission to stay in Britain as a refugee.

Judge Nicholas Madge ruled the sex attacker must receive damages – but said he ‘wholeheartedly’ agreed that people would believe Bah’s victims deserved payouts rather than him. The judge said that he had been forced to uphold the principle that no one should be imprisoned unlawfully in a civilised society.

The case sparked fresh demands for ministers to make it harder for foreign criminals to block moves to remove them from Britain.

Conservative MP Peter Bone said: ‘The public will look at this case and conclude the law is an ass. It is very difficult to understand why a sex attacker should not be sent home, let alone win a vast amount of public money.

‘If he has come to the UK he should live by the rules of the UK. My constituents will quite rightly be outraged at how he has been rewarded despite thoroughly abusing the hospitality of this country.’

David Green, of think-tank Civitas, said: ‘This is a clear case of punishing the Home Office for protecting the public.

‘This is perverse and a clear failure of the duty of the courts. It’s not like they have kept him inside for no reason – he is a danger to the public.’

Central London County Court was told that Bah should not have been held in custody after his sentences ended because he had been granted asylum.

And, as Guinea’s embassy had refused to issue him travel documents, there was never a realistic prospect of deporting him – a key test when placing a foreign criminal in immigration detention.

Bah, who arrived in the UK in 2007 to join his refugee father, was convicted of sexually assaulting a 16-year-old in February 2011. He was jailed for 18 months then imprisoned again in 2014 – for two years – over another sex assault.

The Guinea Embassy had refused to issue him with travel documents and has not taken anyone back from the UK since 2006, the High Court heard

The Home Secretary signed a deportation order against him in December 2011, without realising he was entitled to be treated as a refugee. Bah, of Southampton, was held in immigration detention unlawfully for two periods – 2012 to 2013 and 2014 to 2015 – totalling 21 months.

The judge said that nobody had been successfully deported to Guinea since 2006 as the authorities there refuse to issue travel papers to anyone who does not want to return.

Judge Madge said Bah had served punishments for his crimes and was due compensation only because of the Home Office’s failure to properly apply its own policy. Foreign criminals who commit serious offences are automatically considered for deportation, but once the offender is released they are rarely put on a plane home.

They can be placed in a detention centre only if there is a realistic prospect they will be removed swiftly because judges would otherwise order them to be released. It means thousands of criminals are placed back in the community with a request to keep in touch with immigration officials. But many simply slip off the radar.

In 2014, the Home Office was forced to admit it had lost track of 758 dangerous foreign criminals awaiting deportation.

Among those who had gone missing were ‘high harm’ individuals at risk of committing the gravest crimes.

Data published last week showed that, in September, 5,933 offenders from overseas were walking the streets of Britain – the highest number since 2012.

In the third quarter of the year, a total of 533 overseas offenders – including citizens from the Caribbean, Africa and Eastern Europe – were released on to the streets despite being eligible for deportation.

In the third quarter of the year, a total of 533 overseas offenders – including citizens from the Caribbean, Africa and Eastern Europe – were released on to the streets despite being eligible for deportation. Of these, only five were actually booted out of the UK.

Another three were given permission to stay. The rest were challenging their deportation orders, many using controversial human rights or asylum laws, while others did not have travel documents so could not be removed immediately.

Refugee status does not automatically prevent a person being deported after committing a crime, but the Home Office first has to strip them of the status – a process which can drag through the courts for years.

The Home Office said: ‘People who have no right to live in this country should be in no doubt of our determination to remove them. We have removed more than 41,000 foreign national offenders since 2010.

‘We are now considering the judgment but this case does not change the legality of Mr Bah’s status in the UK.’