Hamid Nehal Ansari, a Mumbai resident, was taken into custody by Pakistani police and Intelligence Bureau (IB) officials in Kohat near Peshawar in November 2012.

A 31-year-old Indian national, who had gone missing in Pakistan in 2012, has been sentenced to three years in prison by a Pak military court for espionage.Hamid Nehal Ansari was convicted on Sunday in Kohat, a city in the Khyber Pakhtunkhwa province of Pakistan, and was shifted to Peshawar Central Prison, a jail spokesman said.He has a right to appeal under the Pakistan Army Act.India had sought consular access for Mr Ansari, an engineer, and asked Pakistan to ensure his safety and security.According to Dawn, Mr Ansari has confessed to illegally entering Pakistan from Afghanistan for espionage. He had seven Facebook accounts as well as around 30 email addresses. He was reportedly found to be in possession of sensitive documents, it claimed.Over three years after Mr Ansari went missing in Pakistan where he had allegedly gone to meet a girl he had befriended on the Internet, authorities last month admitted that he has been in army custody and facing a trial in military courts.In light of the information, a two-member bench had on January 13 disposed off a habeas corpus petition filed by Fauzia Ansari, the convict's mother, against his alleged illegal detention.Court had asked the government to respond to the petition by Fauzia Ansari on the whereabouts of her son.In response, Military Intelligence Directorate intimated that Mr Ansari was in military custody and is being tried by a military court.Mr Ansari, a Mumbai resident, was taken into custody by police and Intelligence Bureau (IB) officials in Kohat, about 70 kms from Peshawar, in November 2012. Ever since, his whereabouts were unknown. Mr Ansari's mother claimed he was in touch with some Pakistani friends who had suggested him to cross into Pakistan from Afghanistan without a visa. She claimed that he had befriended a Pakistani woman through social media and had gone to Pakistan to meet her.