The boy, Iftikhar Ahmed, was handed over to Pakistan Rangers at Wagah where his mother was waiting for him for several hours.
"I am extremely happy to have my son back. I am thankful to the Pakistani government for its help for return of my child," Iftikhar's mother Rohina Kiyani told reporters at Wagah.
"I had lost all hope of getting my child back. It's not a less than a miracle for me," she said.
Rohina with the help of Pakistan High Commission in New Delhi filed a case in an Indian court that ruled in May 2016 in her favour.
More From This Section
After the case was taken up by the Pakistani high commission and proven that Iftikhar was a Pakistani by nationality, the verdict was given that he be returned to his mother in Pakistan.
Meanwhile, as per intelligence sources, the boy was brought to India through Nepal route. The father-son duo had also spent some time in Ganderbal district of Jammu and Kashmir before that, they said.
The boy, who was handed over to Pakistan Rangers at Wagah, where he reunited with his mother, was issued an Emergency Travel Certificate by the Pakistani High Commission in New Delhi.
5-year-old Iftikhar Ahmed was accompanied by Fozia Mansoor, counsellor at the Pakistan High Commission.
According to official posted at Attari border, the boy had been taken "forcibly" to India by his father, who belongs to Jammu and Kashmir, a year ago.
On reaching Pakistan six years back, he married a Pakistani Girl Rohina Kiyani and had a son with her.
The officials further said that Gulzar left Pakistan in 2016 with his son Iftikhar, while lying to his wife that they were going to India to attend a wedding.
Actually, he had already planned to surrender before police in J&K since he wanted to return to the national mainstream and lead a normal life with his son, an official said on condition of anonymity.