A High Court judge wants to know why two Chinese men were kept in jail weeks after completing sentences for drugs offences.
Mr Justice Weatherup ordered immigration officials to provide more details before he rules on the judicial review challenge by the ex-prisoners.
Yun Quan Wang and You Qui Shi claim they were illegally held in Maghaberry Prison for nearly three weeks before being transferred to an immigration removal centre in July.
The two men were originally jailed in connection with the discovery of a cannabis-growing operation in Downpatrick, Co Down.
They are being detained in London amid deportation proceedings.
Under the regulations, prisons should only be used in immigration cases when there are security issues.
Steven McQuitty, counsel for the pair, claimed the UK Borders Agency had failed to follow policy guidelines.
But Tony McGleenan, for the authority, criticised the lack of sworn affidavits from either applicant.
The judicial review hearing was adjourned until next month to allow time for the information to be supplied.