An illegal immigrant who was convicted of sexually abusing two women on a rush-hour train could receive up to £7,000 because he was kept in jail for ‘too long’ as officials tried to deport him.

Naseer Chawki was detained for four years while Home Office officials tried to have him deported. A High Court judge has now ruled that he had been illegally held for seven months and thus had his human rights violated.

The Daily Mail reports that although there is as yet no indication of the exact amount to which Chawki is entitled, a 2013 Supreme Court judgment set a precedent that people detained illegally should receive £1,000 for each month they are detained, meaning Chawki could receive £7,000.

The court heard how Chawki arrived in Cardiff from Iran in 1999 before relocating to the Seven Sisters neighbourhood in London. In 2008, he was sentenced to three years imprisonment for two sexual assaults on the London Underground’s Piccadilly Line.

The attacks, in which Chawki “pressed himself against the women on a crowded rush-hour train”, were witnessed by commuters. He was later caught thanks to DNA evidence and Oyster card records.

During sentencing for the offenses at Southwark Crown Court, judge Martin Beddoe said he would recommend deportation for Chawki after he had served his time. He was released in December 2009 and then placed in immigration detention while officials began the process of deporting him.

However, he was released from detention last year after the attempts failed, and then launched a legal battle saying he had been wrongfully held when it became clear he had “no prospect” of being deported.

Deputy High Court Judge Stephen Morris ruled that his detention had been lawful for most of the four years he had been held, but ruled that it was unlawful from September 2013 to March 2014. By that time there was “no sufficient prospect of removal within a reasonable time”, he said.