THOUSANDS of foreign students may have been falsely accused of faking their ability to speak English and ordered to leave the country because of the Home Office's "hostile environment" crackdown on illegal immigration, it has emerged.

Students who were said to have cheated on English proficiency tests were not been allowed to appeal against the Home Office decision, produce evidence in their defence, or meet officials face-to-face so the quality of their English can be assessed.

But it has been claimed that many were actually innocent and were wrongly singled out by the US-based firm officials hired to analyse test results.

The claims, made by the Financial Times, come as Theresa May faced growing pressure on her immigration policies after it emerged that she overruled Cabinet ministers pleading for more doctors from overseas to fill empty NHS posts.

At least three government departments lobbied for a relaxation of visa rules to let in doctors as well as specialist staff sought by businesses.

The issue erupted on Friday when several NHS trusts in England went public about fears that patient safety was being put at risk by doctor shortages.

The harsh treatment of the foreign students, who were in the UK legally, has been compared to the harassment suffered by some members of the Windrush generation of pre-1973 Commonwealth migrants to the UK as officials sought to make illegal immigrants leave the country of their own accord.

In a judgment on the case of one Bangladeshi student, published last year, an immigration tribunal judge said that the Home Office’s behaviour was ”so unfair and unreasonable as to amount to an abuse of power.”

Patrick Lewis, an immigration barrister who has represented several of the affected claimants and overturned the Home Office’s ruling in each case, told the FT: “The highly questionable quality of the evidence upon which these accusations have been based and the lack of any effective judicial oversight have given rise to some of the greatest injustices that I have encountered in over 20 years of practice."

He added: “I just don’t understand the way in which the government has approached this. They [the students] have had their lives turned upside down by these allegations.”

The foreign students' plight began when the BBC’s Panorama programme aired an investigation in February 2014 alleging systematic cheating at some colleges in the Test of English for International Communication (TOEIC), one of a number of tests that students can take to meet visa requirements on English proficiency.

Mrs May responded by asking Educational Testing Services, the US-based company that ran the system, to analyse voice files to work out if students were using proxies to sit the tests for them.

After analysing the files, ETS said it was confident 33,725 test takers had used someone else to sit the test for them.

But an immigration appeal tribunal in 2016 heard that when ETS’s voice analysis was checked with a human follow-up, the computer had been correct in only 80 per cent of cases - meaning that some 7,000 students had their visas revoked in error.

Stephen Timms, MP for East Ham, in whose constituency some of those affected live, said overseas students had been issued with refusals, curtailments of the right to remain or removal directions, on the basis of “dubious allegations” by a testing company. “Conversations with those affected have convinced me that many were entirely innocent,” Mr Timms said. “Their treatment has been shameful.”

The Home Office did not immediately respond to a request for comment.