The high court has rejected calls to free hundreds of immigration detainees who, lawyers and human rights activists say, are at risk from Covid-19 while behind bars.

The ruling, following a hearing over Skype on Wednesday, was handed down in response to an urgent legal challenge from Detention Action.

The legal action asked for the release of hundreds of detainees who are particularly vulnerable to serious illness or death if they contract the virus because of particular health conditions, and also for the release of those from about 50 countries to which the Home Office is currently unable to remove people because of the pandemic.

The two judges – Dame Victoria Sharp, president of the Queen’s Bench division, and Mr Justice Swift – came down strongly on the side of the Home Office and highlighted the range of measures already being implemented by the home secretary, Priti Patel.

These included the release of more than 300 detainees last week, ongoing assessments of the vulnerability of individual detainees to the virusand a range of “sensible” and “practical” steps the Home Office is taking to make detention centres safer, such as single occupancy rooms and the provision of face masks for detainees who wish to wear them.

“It seems likely that the arrangements already in place by the secretary of state will be sufficient to address the risks arising in the majority of cases,” the judges said, adding that “the present circumstances are exceptional”.

The court hearing on Wednesday heard that 736 people are still being detained in the UK, while 350 have been released in recent days. It was also confirmed that detainees in three detention centres have displayed symptoms of Covid-19.

The Home Office previously confirmed to the Guardian one case of Covid-19 on Sunday at Yarl’s Wood immigration removal centre in Bedfordshire, which mainly houses women.

Million undocumented migrants could go hungry, say charities Read more

The court heard that in a second centre - Brook House, near Gatwick airport - one detainee who had displayed symptoms was reportedly serving food to other detainees just before he fell ill.

Chris Buttler, representing Detention Action and also representing a detainee who lawyers say is at greater risk from Covid-19 because he suffers from high blood pressure, told the court that expert evidence suggests the virus “will run rampant” through detention facilities.

He argued that the home secretary was acting unlawfully and falsely imprisoning many detainees because removals are no longer possible to 49 countries and it is difficult to remove people to many others.

He said that the Home Office was a “glaring exception” to the government’s moves to suppress Covid-19 and that leaving people in detention would further burden the already overstretched NHS when they get sick.

“The home secretary is arguably falsely imprisoning some clients who there is no realistic risk of removing,” Buttler told the court.

Lisa Giovannetti QC, representing the Home Office, told the court: “Government accepts all reasonable steps should be taken to shield people in high-risk categories and we have been proceeding on that basis. I can’t claim the system is perfect but it’s a reasonable one.”

She said reviews to identify the most vulnerable detainees were under way and this process is due to be completed imminently, adding that numbers in immigration detention have fallen substantially from 1,200 in January to 736 now.

As part of Detention Action’s case, the public health expert Prof Richard Coker, of the London School of Hygiene and Tropical Medicine, provided an expert report warning that prisons and detention centres provide ideal incubation conditions for the rapid spread of the coronavirus, and that about 60% of those in detention could be rapidly infected if the virus gets into these locked facilities.

Toufique Hossain of Duncan Lewis Solicitors, who brought the case, said: “This litigation has brought about the release of hundreds of detainees, preventing many from suffering serious harm.

“Hundreds more remain in detention in terrible conditions. Though we are disappointed with the ruling today, this action has clearly focused the minds at the Home Office on vulnerable individuals they usually wilfully neglect.”

Bella Sankey, Director of Detention Action, said: “While the high court declined to grant our interim relief tonight, our litigation has already forced major and rapid concessions from the government: 350 people released from detention in the past week; an undertaking to proactively review the detention of all those held under immigration powers according to updated guidance and with a view to further significant releases; and a very strong presumption against any new detentions for people facing removal to around 50 countries.

“The government has also been forced to issue new guidance on hygiene standards in detention and to accept that detention poses high risks to those with Covid-19-relevant underlying health conditions.

“We will monitor the implementation of all these guarantees and continue to hold the government to account.”

A Home Office spokesperson said: “We welcome the court’s decision. Immigration Enforcement is responding to the unique circumstances of the coronavirus outbreak and following the latest guidance from Public Health England. The safety of detainees and staff is of vital importance.

“Decisions to detain are made on a case-by-case basis and kept under constant review, but our priority is to maintain the lawful detention of the most high-harm individuals, including foreign national offenders.’’