It has been described as the “black hole at the heart of British justice”. Thousands of people, most of whom have been convicted of no crime, detained for as long as government officials wish.

Britain is the only country in Europe to allow the indefinite detention of migrants – leaving them in a legal limbo condemned as “barbaric” and abhorrent” by critics.

But ministers are now facing the biggest ever challenge to the draconian powers, as a growing coalition of campaign groups, civil society organisations and religious leaders demand that the maximum length of immigration detentions be capped.

In the run-up to the election, Citizens UK, the largest alliance of civil society organisations in the country, is to call on all prospective MPs to pledge a time limit on the detention of migrants.

Jonathan Clark, the Bishop of Croydon who is backing the drive, said: “Detaining people indefinitely in prison-like conditions without judicial oversight is unjust, ineffective and inhumane.That’s why Citizens UK are calling on people of goodwill across the country to join them in taking this issue to their parliamentary candidates.

“We will ask politicians to pledge their support for a time limit on the detention of adults – and to work with us… to make it happen.”

Separately, more than 30 charities and organisations are now calling for a time limit of 28 days’ detention.

The calls are being led by the Detention Forum, whose members range from the Migrants’ Rights Network to the Prison Advice Service. Eiri Ohtani, coordinator, Detention Forum, said: “Barbaric and uncivilised, the practice of locking up migrants indefinitely has no place in Britain.”

The backlash against the Home Office’s approach comes after The Independent revealed this week how 20 people have been held for more than two years.

A security officer walks down one of the corridors of Yarl's Wood Immigration Removal Centre (Reuters)

They are among more than 3,300 people kept in detention “solely under Immigration Act powers” in removal centres such as Yarl’s Wood, which has faced allegations of abuse and mistreatment of inmates by staff. Hundreds of others are held in prisons under the same immigration powers. Jerome Phelps, the director of Detention Action, said: “Immigration detention is a black hole at the heart of British justice. Suspected terrorists can only be held without charge for 14 days, yet asylum-seekers are routinely held for years, simply because a civil servant has failed to arrange their deportation.”

He added: “Most long-term detained migrants return to their communities in the UK, bearing the scars of indefinite detention. It is quite simply a dysfunctional practice that wastes taxpayers’ money and human lives.” Dr Lisa Doyle, head of advocacy, the Refugee Council, said: “It’s utterly abhorrent that at the stroke of a pen a Government official can deprive someone of their freedom indefinitely, without them having being charged with or convicted of any crime.”

The cost of the “Immigration Detention Estate” to the taxpayer is more than £164m a year. And millions more are spent on compensating people who have been unlawfully detained. More than £75m annually is wasted on detaining migrants who are then released, say campaigners.

Britain is the only European country where migrants can be detained indefinitely, having opted out of the EU Returns Directive, which sets a maximum time limit of 18 months. The UN Committee against Torture, in May 2013, urged Britain to “introduce a limit for immigration detention and take all necessary steps to prevent cases of de facto indefinite detention.”

Yet the number of people being locked up is at record levels, with more than 30,000 put into detention at some point each year. At any one point in time, several thousand people are in detention under immigration rules.

Most of those are failed asylum-seekers, while others may be those whose visas may have run out, or who had indefinite leave to remain until being given a deportation order. In many cases, those who are held for long periods are from counties with barriers to removal, such as Somalia, Iran, and Eritrea. Others are detained because they are ex-offenders and regarded a “flight risk.”

The call for a time limit on how long people can be held is likely to be a key recommendation in a report to be published next month by the first ever cross-party parliamentary inquiry into immigration detention.

A Home Office spokesman said: “No one is held in immigration detention indefinitely. Individuals are detained for the shortest period necessary and all detention is reviewed on a regular basis to ensure it remains justified and reasonable. We have a duty to protect the public from those who pose a risk of harm and, in particular, those who have committed serious criminal offences. It is open to any individual held in immigration detention to apply for bail or challenge the decision in the courts.”

In limbo: Detainees stories

One former detainee, Souleymane, from Guinea, said: “I was in detention for three-and-a-half years... Lots of people around me collapsed mentally. They cut their wrists or hung themselves. They couldn’t take the endless not-knowing. They couldn’t take the sense of hopelessness that is the younger brother of indefinite detention – it’s always following it around, the two come together.” The 51-year-old, who was released three years ago and lives in Reading, has since received compensation for unlawful detention.

Mukala, 33, from Uganda, said: “I came seeking freedom, yet I was locked up for over a month in Yarl’s Wood detention centre. I had committed no crime, yet I was put in a cell in what was essentially a prison... The worst part was not knowing when I would be released; it felt like I would being detained forever. It was scary and at times difficult to cope.” Mukala was detained in 2010 before being released on medical grounds, and now has indefinite leave to remain.