Ansari, a 33-year-old Mumbai resident, was lodged in the Peshawar Central Jail after being sentenced by a military court to three years' imprisonment for possessing a fake Pakistani identity card on December 15, 2015

ISLAMABAD: Pakistan on Monday released Indian prisoner Hamid Nihal Ansari, whose three-year jail term ended on Saturday, days after a top court gave one month deadline to the government to complete formalities to deport him.

Ansari, a 33-year-old Mumbai resident, was lodged in the Peshawar Central Jail after being sentenced by a military court to three years' imprisonment for possessing a fake Pakistani identity card on December 15, 2015.

Foreign Office Spokesperson Mohammad Faisal claimed that Ansari was an "Indian spy who had illegally entered Pakistan."

Ansari, who was "involved in anti-state crimes and forging documents, is being released upon completion of his sentence and is being repatriated to India," the spokesperson said.

He was arrested in Pakistan in 2012 for illegally entering the country from Afghanistan, reportedly to meet a girl he had befriended online.

His jail term ended on December 15 but he was not able to leave for India as his legal documents were not ready.

On Thursday, the Peshawar High Court granted the federal government a month deadline to complete his repatriation process.