It was the coalition government that pushed a policy of outsourcing immigration enforcement that became a licence to discriminate

There was stunned silence in the cabinet room. Ministers exchanged awkward glances. Officials looked at their shoes. Had the prime minister really just stormed out?

It was May 2013 and a red-faced David Cameron had suddenly packed up his briefing folder and left, with a full agenda far from complete. It brought an abrupt end to the gathering known as the inter-ministerial group on migrants’ access to benefits and public services – dubbed the Batmaps committee by civil servants.

With the Tories under pressure from a bullish Ukip, the prime minister had raised his latest idea for creating a “hostile environment” for illegal immigration – forcing landlords to check the immigration status of their tenants. The only problem was, he could barely find anyone around the table to support it.

Ministers kept raising awkward questions. Wouldn’t landlords simply stop offering tenancies to people with foreign-sounding names? Would landlords really have the skills to operate like border guards? Cameron eventually turned to the junior Tory ministers in the room in search of some unqualified backing. When it failed to materialise, he packed up and left.

“He walked out in a strop, which was highly unusual,” recalls David Laws, a Lib Dem Cabinet Office minister at the time. “If you take decisions that are based only on the fears of mass immigration without thinking through the risks, you will have problems. Some Tories were aware of that.”

Theresa May and her home secretary, Amber Rudd, have spent the past week apologising to the Windrush-era citizens who had found their immigration status called into question, despite having the right to be here. The apologies have been accompanied by a suggestion that the crisis is an aberration by officials “too concerned with policy”.

To those who have been warning about such a crisis, however, their treatment is far from a momentary lapse. It is, they claim, the entirely predictable consequence of creating a hostile environment for illegal immigrants that risked collateral damage as the price of appearing tough. Anyone without the right documents would have to prove their case – and policies with unintended consequences would need to be pursued to show action was being taken.

While some measures designed to make life harder for illegal migrants date back to the last Labour government, most Whitehall insiders and immigration experts point to the arrival of the Tory-led coalition government in 2010 as the moment when the “hostile environment” mission began in earnest.

Everyday life was to be made impossible for those without proof of their legal status. Should they try to find a job, open a bank account, access healthcare or rent a room, they would meet with a demand for papers.

As Cameron’s frustration at the Batmaps committee had shown, the need to act tough on immigration was a powerful driver in Downing St after 2010. Electoral pressure from Ukip, which was securing record poll ratings, was focusing minds and had already contributed to the adoption of the pledge to reduce net migration to the “tens of thousands”. The same pressures encouraged Cameron to back an EU referendum.

The temperature was raised further in 2013 when the Home Office sent out controversial “go home” vans telling illegal immigrants to leave the country. Nick Timothy, May’s former adviser, has since said that she blocked the vans, only for the policy to be rolled out while she was on holiday. His claim was contradicted by a written ministerial answer in 2016. It stated that while the scheme was approved by the former immigration minister Mark Harper, May “was informed of the intention to pilot this campaign”.

Measures clamping down on the undocumented were accelerated after the 2015 election. Rules were tightened for access to secondary healthcare, existing bank account holders and – despite a lack of support back in May 2013 – the plan to force tenants to show they had a “right to rent” was rolled out across England.

Together with a change in the rules, some on the frontline say they detected a change in institutional attitude. “The hostile environment is actually two things,” says Adrian Berry, a leading immigration lawyer. “It is a series of legislative initiatives to make it much more difficult to lead an ordinary life in the UK, but secondly, a change in direction in the way the Home Office assesses individual people.

“Essentially, you are under suspicion as being unlawfully present unless you can rebut that. We had immigration tests for benefits applications anyway. It’s just that those people started to be treated with much more suspicion.”

Even after Rudd’s apology for the Windrush cases, it has emerged that she was privately pushing plans to tighten the net further. In a leaked private letter to May last year, she vowed to give immigration officials more “teeth” to deport thousands more illegal migrants. Rudd even implied that she wanted to switch money from low-level crime-fighting to her immigration enforcement programme. Her proposals came before the Windrush cases began to emerge.

Unintended cases began to roll in. At risk are people who arrived here as part of an open-ended invitation to settle in the UK, but without the high levels of paperwork now required to access many services or satisfy the Home Office.

As a result, some of those who came over with their parents from the Caribbean in the 1950s and 1960s have been affected. Albert Thompson (not his real name) was denied cancer treatment after failing to prove he was a legal resident.

Winston Jones (not his real name), who arrived in London in 1972 as a 16-year-old, lost his tenancy after he was admitted to hospital with a brain aneurysm and told he may have to pay for his treatment.

Junior Green, 61, visited his dying mother in Jamaica last year but was refused readmission. While he secured a temporary visa, he missed his mother’s funeral.

Facebook Twitter Pinterest Albert Thompson was denied cancer treatment after failing to prove he was a legal resident. Photograph: Jill Mead/the Guardian

The Home Office maintains it is “wilfully misleading to conflate the situation experienced by people from the Windrush generation with measures in place to tackle illegal immigration and protect the UK taxpayer”.

The web of potential triggers has caused immigration issues to arise in unpredictable ways. “We have supported someone who came in 1968 when she was 15,” says Sally Daghlian, head of the Praxis Community Projects charity. “She didn’t have any immigration problems until 2016, when her youngest daughter applied for a British passport. She was told she couldn’t get the passport because her mother didn’t have permission to be in the UK. Her mother then got a letter from the Home Office saying that she had to make immediate arrangements to leave the country, or she might be removed.”

Berry adds: “If you switch employer, having worked for someone for 20 years, you probably wouldn’t have had an immigration test before. But now you will have one – and could find you have no documentation. I’ve seen an increase in cases.”

Chris Norris, director of policy and practice at the National Landlords Association, recalls an unusual round-table event at the time the policy for tenant immigration checks was being developed.

“The round table involved us, homelessness representatives and local authorities,” he says. “I’m not sure I’ve ever been part of one of those working groups where there is so much agreement that it is a bad policy. I don’t think there was anyone around that table who thought this was a good idea.”

The whole agenda has been driven by the need to cut numbers, says the former head of the UK border force Brodie Clark. “The constant government mantra of ‘hundreds of thousands to tens of thousands’, alongside the 50% success rate on asylum appeals, gives a clear picture of the sheer political desperation and pressure to improve the figures,” he says. “To politicians, the number of people removed mattered greatly.”

However, immigration advice workers say that some people worried about their status simply disappear off the grid, rather than leave the country. The consequences can be tragic. “The worst case I saw was a pregnant woman who had no immigration papers,” recalls Rita Chadha, from the Migrants’ Rights Network. “She was suffering from acute pain. We took her to hospital, after three weeks of convincing her. When she got there, they found out the baby had died.”

Then there is the alleged discrimination created by some of the reforms. Recent research by the Residential Landlords Association found that as a result of the “right to rent” checks on tenants, 42% of landlords are now less likely to let to anyone without a British passport.

“The system is inherently prejudicial and xenophobic,” says Satbir Singh, the chief executive of the Joint Council for the Welfare of Immigrants. “It creates a really strong incentive to discriminate. It comes alongside cuts to legal aid for those rejected [for leave to remain in the UK]. Access to justice is subtly removed.”

It is unsurprising in such circumstances that the rights of EU migrants after Brexit are causing some nervousness. As in the Windrush cases, there will be a large cohort of people who were invited to settle freely in Britain who will suddenly be asked to prove their right to remain here after Brexit. Some 3.5 million people are in the group.

“There are obvious parallels between the Windrush generation and EU citizens already living in the UK,” says Madeleine Sumption, director of the Migration Observatory. “The situation of EU citizens ought to be much better as we are in a more hi-tech world and the Home Office is producing a system for giving them documentation. In theory that system ought to work very well. The issue is a group of people who don’t apply for various reasons.”

According to the observatory, children in care could be at risk, as well as vulnerable people like the 50,000 female domestic abuse victims in the group. There are about 239,000 UK-born children in the group whose EU national parents report that they are UK citizens. However, available data suggests that tens of thousands of these children may not be.

Will there be a rethink of the use of hostility as a policy principle? Charity workers helping those at the heart of the current furore live in hope, if not expectation.

“All of this reflects a wider problem,” says Daghlian. “A problem with Home Office record-keeping, a problem with the fees that people are being expected to pay to secure their status, and, inevitably, if you set up a system where you outsource immigration control to non-experts, you end up creating a charter for discrimination.

“If you create a hostile environment, you shouldn’t be surprised that it’s hostile.”