Officials said 33-year-old Ansari, who came back to India on Tuesday, became emotional while talking about the difficult phase of his life in Pakistan.
Ansari, who was accompanied by his mother and other family members, also thanked Swaraj and the Ministry of External Affairs for persisting with the case and taking it up with Islamabad.
The Mumbai resident, who returned to India after crossing the Wagah-Attari border, was imprisoned in the Peshawar Central Jail after being sentenced by a military court on December 15, 2015.
According to official sources, India issued 96 notes verbales to Pakistan seeking consular access to Ansari. The decision to release him was on account of relentless pressure from New Delhi, they said.
Shortly before his arrival on Tuesday, Ansari’s mother Fauzia Ansari told reporters that the prayers of the family and of all those who wished for his safe return had been answered.
“I am immensely happy today. I don’t have words to describe my feelings,” she said.
His father, Nihal Ansari, said, “It is a new dawn for us”.
Ansari was arrested in 2012 for illegally entering Pakistan 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 gave the Pakistan government a month’s deadline to complete his repatriation process.
In reply to a habeas corpus petition filed by his mother Fauzia Ansari, the high court was informed that he was in custody of the Pakistan Army and was being tried by a military court.