The woman Indian national Hamid Nehal Ansari sneaked into Pakistan to meet testified in a Pakistani court in an effort to clear him though the two never got a chance to meet. Ansari, 33, was arrested in Pakistan in 2012 for illegally entering the country from Afghanistan to meet the woman he befriended online. He was held incommunicado for three years before he was given a three-year jail term by a military court in December 2015 on charges of espionage and possessing fake documents. The girl for whom he went to Pakistan actually testified in his favour, that he came to meet her but he was (still) put in jail, external affairs ministry spokesperson Raveesh Kumar said on Thursday. On Tuesday, Ansari was repatriated via the Wagah-Attari border crossing after he completed his prison term. On Wednesday, Ansari and his mother met external affairs minister Sushma Swaraj, who asked him how he had ended up in Pakistan. He explained that through a twist of circumstances, he fell in love with a girl and in pursuit of that girl, he followed her and landed up in Pakistan, Kumar said. There, he was arrested on suspicion of being a spy. He spent more than the time for which he was sentenced and now he is back. People familiar with the case said Ansari never met the woman though she testified on his behalf in a court. They said he decided to travel to Afghanistan and sneak into Pakistan after his application for a Pakistani visa was denied. After he was arrested, Ansari was made to sign a paper which had something written on it in a language he didnt know. It was after this that he was charged with spying, one of these people said on condition of anonymity. Ansari, who reached his home state Maharashtra on Thursday and was welcomed by friends and family, said he learnt three lessons in the past six years do not love anyone on Facebook, do not hide anything from your parents and follow legal procedures while travelling to other countries. I was worried and unsure if I would ever be able to return home from Pakistan, but eventually when I saw there were a lot of people supporting me, I started praying. My family, the Indian government and Sushma Swaraj helped me a lot, he said. I want to celebrate with my family, after that I will start looking for a job and only then will I marry and settle down, Ansari told reporters. The resident of Versova jokingly added, I am thinking I will approach Aamir (Khan) for a movie to be made on me. Ansari said he wanted to meet the woman because she was in distress.