Pakistan on Tuesday released Mumbai resident Hamid Nehal Ansari, who was jailed for three years in 2015 for illegally entering the country in 2012, PTI reported.

Ansari had entered the country to meet a Pashtun woman he had befriended online. On December 15, 2015, the 33-year-old was sent to prison by a military court for allegedly possessing a fake Pakistani identity card. He was then lodged in Peshawar Central Jail.

Pakistan Foreign Office spokesperson Dr Mohammad Faisal called Ansari an “Indian spy who had illegally entered Pakistan and was involved in anti-state crimes and forging documents”.

The Ministry of External Affairs said Ansari’s release was a “matter of great relief”, ANI reported. The ministry called on Pakistan to release other Indians, including fishermen, “whose nationality has been confirmed and who have completed their sentences but continue to languish in Pakistan jails”.

“We hope Pakistan will respond and organise an early visit of Joint Judicial Committee so that issues of prisoners can be dealt with in a humanitarian and timely manner,” the ministry added.

On December 13, Justices Roohul Amin and Qalandar Ali Khan of the Peshawar High Court heard a plea by Ansari’s lawyer Qazi Muhammad Anwar, who claimed that the Pakistan government was silent about releasing his client, The Indian Express reported. Ansari’s prison term ended on December 15 and he should have been released the following morning.

Justice Khan then asked the additional attorney general to explain how they would keep Ansari in jail even after he completes his term.

Last year, Anwar had told the court that his client was not involved in anti-state activities and has the right of sentence remission after spending a long time in prison, The Express Tribune reported.