As many as 164 members of the Windrush generation may have been wrongly removed, detained or stopped at the border, an official review suggests.

The number includes 18 long-term UK residents who are to receive a formal apology from the Home Secretary after analysis by his department uncovered evidence suggesting they suffered “detriment” because their right to be in the country was not recognised.

A trawl of nearly 12,000 historical records provides the most comprehensive indication of the impact of the scandal since it erupted earlier this year.

The Home Office is prioritising 18 cases where individuals’ records indicate they came to the UK from the Caribbean prior to 1973 and stayed permanently.

But they were unable to demonstrate “continuous residence”, resulting in them being removed or detained in an immigration removal facility or a reporting centre.

Eleven people voluntarily departed, with some having been served with immigration enforcement notices informing them they had no right to be in the UK. None of the 11 were held in detention.

In a further seven cases, people were detained and subsequently released without being removed.

The review also identified 74 individuals who it would appear were either detained or removed because they had lost their entitlement to indefinite leave to remain after leaving the UK for more than two years.

A further 72 people were briefly detained at the border before being allowed to enter.

All of those flagged up will be put in contact with a specialist taskforce and pointed to a compensation scheme.

But officials are prioritising the 18 cases where the Home Office is deemed “most likely” to have acted wrongfully.

The Empire Windrush ship
The Empire Windrush ship (PA)

Home Secretary Sajid Javid said: “The experiences faced by some members of the Windrush generation are completely unacceptable and I am committed to righting the wrongs of the past.

“I would like to personally apologise to those identified in our review and am committed to providing them with the support and compensation they deserve.”

Ministers faced a furious backlash over the treatment of the Windrush generation – named after a ship that brought migrants to Britain from the Caribbean in 1948.

Commonwealth citizens who arrived before 1973 were automatically granted indefinite leave to remain under the 1971 Immigration Act.

But some lost their jobs, were denied access to NHS treatment and had their driving licences withdrawn despite living in the UK legally for decades.

The Home Office’s latest review looked at 11,800 cases of Caribbean Commonwealth nationality, born before January 1, 1973, who have been removed and/or detained since 2002. Criminal cases were not included.

It found a total of 164 people who were detained or removed who had something on their file indicating they may have been in the UK before 1973.

Mr Javid said internal analysis shows features of individual cases are “markedly different”.

He added: “The way in which each individual was treated by the department, and the degree of detriment suffered, varied considerably.”

Referring to the 18 priority cases, he said: “These are the people we have so far identified whom we consider are most likely to have suffered detriment because their right to be in the UK was not recognised and therefore where the department is most likely to have acted wrongfully.”

The Windrush failings have been linked to the Tories’ so-called “hostile environment” crackdown on illegal immigration.

But in a letter to Labour MP Yvette Cooper, who chairs the Commons Home Affairs committee, Mr Javid said the new analysis “exposes problems which have happened over many years, under multiple governments”.

Of the 18 cases covered by his apology, four removals and two detentions were before May 2010, when the Conservatives formed the coalition government.

Ms Cooper said it is “vital” the Home Office steps up support for the 18 people.

She added: “Similarly, it is clear from the Home Secretary’s letter that many more people – including those stopped and temporarily detained at the border, despite having the right to be in the UK – have been affected and need contact, support and a similar apology now.”

Shadow home secretary Diane Abbott said the apology is “nowhere near good enough”.

Figures also show 2,272 people were helped to get documentation proving their right to be in the UK under initial arrangements, while 1,465 have been granted citizenship or documents under the Government’s formal Windrush Scheme.