The court's direction came while hearing a case based on the letter sent by Sheikh Abdul Aziz, a 32-year-old Saudi who was sent to jail by a Srinagar court in 2006 for failing to give satisfactory reason for travelling in India without a valid passport and visa.
Aziz had come to Bangladesh, from where he entered India through Kolkata. He remained in Odisha for some time and reached Srinagar through Delhi.
He was apprehended July 27, 2005 in Srinagar and later sent to a year's imprisonment after being charged under the Foreigners Act.
While the Srinagar court directed the authorities to deport Aziz to his native country within two months after his release, no efforts were made, he said in the plea.
The bench also ordered the central government to be in touch with the concerned ministries to look into the matter of continued detention of foreigners in Indian jails.