Police “aged” one of Mao’s childhood photos, according to the state broadcaster CCTV, and used the model to scan the national database and find close matches.
They were acting on a tip-off that a person in a certain area of Sichuan had bought a child in the late 1980s.
On Monday, the now 34-year-old had a tearful reunion with his birth parents who had never given up the search for their missing boy.
Mao’s mother Li Jingzhi told CCTV that after he was taken, she quit her job and sent over 100,000 flyers to officials and appeared on several TV channels to appeal for his return.
Over the past three decades, Li had followed 300 false leads to see if they were her missing son.
But in late April, police in Xi’an were tipped off that a man in Sichuan province had bought a child from Shaanxi in the late 1980s, according to the statement from Xi’an officials.
Police tracked down Mao and later confirmed he was the abducted son of Li Jingzhi after a DNA test.
Mao’s adoptive parents had renamed him Gu Ningning, and he grew up without any knowledge of his birth parents or that he had been abducted.
At the reunion event, organised by Xi’an police, Mao emerged from a side door to a conference room and ran into his mother’s arms.
“I don’t want him to leave me any more. I won’t let him leave me any more,” Li said as she held onto her son’s hand.
Mao, who runs a home decoration business in Sichuan, told CCTV he would move to Xi’an to live with his birth parents.
There are no official statistics on the number of children who disappear every year in China, but a system was established in 2016 to send alerts about missing children through social media and mobile phone texts.
Police have helped more than 6,300 abducted children to reunite with their families over the past decade through the DNA matching system, official news agency Xinhua reported.
Kidnapping and child trafficking became widespread in China from the 1980s, when the draconian one-child rule was enforced, with a cultural obsession with sons also raising demand for kidnapped babies.