Relief on the faces of the Saudi
national and his family
Judge Healey Potani said the state must inform the five of their specific alleged offences under the laws of the country or any other international law.
With no charge or evidence to suggest the men were responsible for any crime, he ruled that the government should release the five detainees - one Kenyan, one Sudanese, one Saudi and two Turkish nationals.
Malawi’s legal system requires suspects appear in court within 48 hours to hear the charges against them.
The five’s defence solicitor, Shabir Latif, said he had obtained the court order because he suspected the government wanted to deport the five on Monday morning and hand them over to the US Central Intelligence Agency (CIA).
He accused the Malawi government of unconstitutional and unlawful conduct by violating his clients' right to freedom of movement.
The five had been working in Malawi, running businesses and teaching at Islamic schools.
Latif said the five, all foreigners and Muslims, were arrested on Saturday morning when police invaded their homes in the Malawi commercial capital, Blantyre.
He said they were blindfolded and questioned by police.
Malawian authorities acted on information given to them by US security officials, Malawi's public prosecutor said on Monday.
"US operatives … are holding al-Qaeda suspects in Malawi's capital Lilongwe. The US government is pressing for their immediate deportation," prosecutor Fahad Assani told journalists in the capital, Lilongwe.
But the court order barring their deportation was obtained late on Sunday.