A long-running programme to deport foreign students from the UK on the basis of hearsay evidence was in ruins today, after the appeal court ruled against the Home Office.

The decision to quietly shelve the legal challenge is a damning moment for Theresa May, who presided over the department when it used flimsy evidence to threaten tens of thousands of foreign students with detention and deportation.

The Home Office argued in a court case that the students had fraudulently completed English language tests, but was unable to point to any expert evidence substantiating its accusations. Its own officials, whose testimony it had put forward as proof of student fraud, were dismissed by the court as lacking "qualifications or expertise, vocational or otherwise, in the scientific subject matter of these appeals".

The department appealed that ruling but today its case was dismissed as "fundamentally misconceived".

The ruling opens up the possibility of thousands of students, who have been kept in limbo since March while the Home Office appealed, winning their legal battle against the government.

How Politics.co.uk reported the student deportation scandal:

Without due process: How Britain deported 50,000 students

Disaster for Theresa May as legal ruling brings student deportations to a halt

The human cost of Theresa May’s student deportation programme

The Home Office appeal originally claimed that the case was unfair, that the deputy judge was biased, that witnesses had not been given an opportunity to explain evidence properly, and that the tribunal had misunderstood expert evidence.

But lawyers for the student in the case say they received a surprising letter from the Home Office suddenly capitulating and admitting there were “no compelling reasons to pursue the appeal”. It also offered to pay costs if the appeal was withdrawn.

In a hearing today, the court decided to pass a judgement, regardless of the Home Office's attempt to withdraw its own appeal.

It is currently unclear whether other students accused of fraud under the programme will be able to use the judgement in their cases.

Some cases will certainly be conceded while others are likely to be offered settlements, but that may still leave thousands of students uncertain about their legal status.

The court today asked the Home Office to come up with a policy detailing what it will do in these cases.

There is a stark divide in the deportation cases between those students offered a right of in-country appeal and those told they had to appeal out of country.

The students forced into the out-of-country appeal route often suffered dawn raids by immigration enforcement, followed by an indefinite period of detention, followed by deportation - all on the basis of evidence the courts then found to be worthless. Their only legal redress was in a court case in their home country, which would have seen their existing British student visa expire regardless of whether they won or lost.

For many students, who had spent thousands of pounds coming to the UK to study, the sudden threat of deportation and subsequent costly legal battle left them without money or the qualification they originally came to the UK to pursue.