Chief judicial magistrate K M L Nongbri passed the order.
An almost inaudible Ahmed, who was arrested on May 12 night while wandering at Golf Link area for entering India without valid papers and suffered from kidney and cardiac problems, told the judge about his ailments and that he could not sleep.
His counsel S P Mahanta backed him and produced medical certificates from the hospitals.
Ahmed was charged under Section 14 of the Foreigner's Act for not carrying valid travel documents.
More From This Section
Prior to his being produced in the court, Ahmed, who was brought to the court under heavy security, told reporters that he has chest pain and also looked weak.
He was discharged from NEIGIHMS yesterday afternoon and was under police custody where he was grilled for several hours.
Since his arrest, Ahmed had been under treatment first at Shillong Civil Hospital and then at NEIGRIHMS.
Last week, Ahmed's counsel had moved court seeking bail for Ahmed's treatment in a better hospital in Singapore where he had been undergoing treatment prior to his disappearance from Bangladesh in March.