Pakistan has released Indian national Hamid Nehal Ansari from prison on Wednesday, reports PTI.Hamid Nehal Ansari, an Indian national who spent three years in a Pakistani jail on charges of espionage after being arrested in 2012, will return home on Tuesday.The 33-year-old was arrested by intelligence agencies in Pakistan in 2012 after he allegedly entered northwest Pakistan illegally to meet a woman he befriended online. He was tried by a military court and given a three-year sentence in 2015 for possessing a fake Pakistani identity card on December 15, 2015.The Mumbai resident was lodged in the central jail in Peshawar after being sentenced by the military court. His jail term ended on December 15, 2018, but he could not leave for India as his legal documents were not ready.According to legal experts, he should have been freed earlier as he had already spent three years in jail at the time of his sentencing.Also read: Indian national Hamid Nehal Ansari to return from Pakistan prison on TuesdayAnsari, a software engineer, went missing after he was taken into custody by Pakistani intelligence agencies and local police in Kohat in Khyber-Pakhtunkhwa. The Peshawar high court was informed he was in custody of the Pakistan army and was being tried by a military court only after his mother, Fauzia Ansari, filed a habeas corpus petition through Pakistani lawyers.Speaking to ANI, Hamid Ansari’s mother Fauzia said that his release is a victory for humanity. Saying that Hamid’s release was a victory for humanity, his mother Fauzia said, that he shouldn’t have gone without a visa. “He went with noble intentions but initially went missing and was later caught and framed. He shouldn’t have gone without a visa. His release is a victory for humanity,” she told ANI. Indian national Hamid Ansari who was lodged in a jail in Pakistan, is being released today. His mother says, &quot;He went with noble intentions but initially went missing and was later caught and framed. He shouldn&#39;t have gone without a visa. His release is a victory for humanity.&quot; pic.twitter.com/LcfHQxblyX&mdash; ANI (@ANI) December 18, 2018The external affairs ministry had raised the issue of Ansari in a note verbale, or formal communication, sent to Pakistan on December 11 amid fears that he would be held for almost a month for completion of formalities after his sentence ended on December 15.Also read: Pakistani court gives govt a month to deport jailed Indian nationalThe Peshawar high court had recently given a one-month deadline to the Pakistan government to complete formalities for Ansari’s repatriation after hearing an appeal filed by his lawyer.Officials said Ansari’s case was a violation of the Vienna Convention on Consular Relations. Pakistan had not responded to 96 requests by India for consular access.Also read: Imran Khan says will look into case of Indian prisoner in Pakistan“#HamidNehalAnsari, an Indian spy who had illegally entered Pakistan and was involved in anti-state crimes and forging documents, is being released upon completion of his sentence and is being repatriated to India,” Pakistan’s foreign office spokesperson Mohammad Faisal tweeted on Monday. #HamidNehalAnsari, an Indian spy who had illegally entered Pakistan and was involved in anti-state crimes and forging documents, is being released upon completion of his sentence and is being repatriated to India.&mdash; Dr Mohammad Faisal (@DrMFaisal) December 17, 2018The external affairs ministry said it had received a note from Pakistan saying Ansari would be released on Tuesday.