Pakistan jail
Indian national Hamid Nehal Ansari has been sentenced to three years imprisonment for espionage by a court martial by the Pakistani Army. In picture: A police officer walks past Central Jail in Peshawar June 21, 2012.Reuters

An Indian man, who was thought to have been missing in Pakistan since 2012 and was revealed to be in the custody of the Pakistan Army last month, has been convicted of espionage by a court martial and has been given a three-year jail sentence, Pakistani media reports.

Hamid Nehal Ansari, who hails from Mumbai, had reportedly travelled to Kohat in Pakistan to meet a woman whom he had befriended through social media. He then lost touch with his family, who remained unaware of his whereabouts till last month when Pakistan's defence ministry revealed that Ansari was being court-martialled by the Pakistani Army. 

Ansari was sentenced to three years behind bars following his conviction, Sunday, Dawn reports. According to the Pakistani newspaper, Ansari, who was a teacher at a Mumbai college, confessed to illegally entering Pakistan from Afghanistan for espionage, and also possessed sensitive documents. He is now being kept at the Peshawar Central Prison. 

Ansari's mother had filed a habeas corpus petition last month to challenge his illegal detention in Pakistan, and Indian officials had said that they were seeking consular access from Pakistan on the issue. 

Ansari had been arrested from a hotel in Kohat in 2012 after he had travelled to Pakistan from Afghanistan. 

"Hamid decided to pursue an alternate career in aviation and lined up for a job interview in Afghanistan. He travelled to Kabul on November 4, 2012 and was due to return to India on November 15 which did not happen," his mother Fauzia Ansari had told The Times of India