Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

ISLAMABAD, Pakistan — The kidnapped son of a powerful Pakistani judge was found hidden under a burqa as his abductors tried to sneak him across the border to Afghanistan, the army announced Tuesday.

Pakistani Army spokesman Lt. Gen. Asim Bajwa said Awais Shah — who had been missing a month — was discovered bound and gagged in a back of an SUV after a firefight in the lawless northwestern Khyber Pakhtunkhwa province at around 2 a.m. (5 p.m. ET Monday).

Awais Shah sits on the ground shortly after having been rescued on Tuesday. Pakistan Army

Bajwa told reporters in Rawalpindi that a Taliban-al Qaeda splinter group was behind the kidnapping and had been trying to take Shah across the border to Afghanistan.

Three kidnappers had been tracked by the army for three days and were killed when they tried to speed by a checkpoint just after midnight near the city of Tank, Bajwa said.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

When the soldiers got close to the vehicle they saw what appeared to be a woman wearing a burqa.

"They took off the burqa and saw that it was a man and his mouth was taped shut," Bajwa said. "As soon as they took the tape off him, he claimed to be Awais Shah, the son of the chief justice.”

Shah's father is Sindh High Court Chief Justice Sajjad Ali Shah, who serves in Karachi, Pakistan's largest city.

The younger Shah was kidnapped on June 20 from the upscale suburb of Clifton in Karachi. After a massive effort to find him failed, the government announced a $100,000 bounty for information leading to his rescue.

Chief Justice Sajjad Ali Shah of the Sindh High Court in Karachi embraces his son after he was rescued, July 19, 2016. Pakistan Army

"All credit goes to the Army," Chief Justice Sajjad Ali Shah told reporters after reuniting with his son at an military airport in Karachi.

He had “absolutely no idea” who was behind the kidnapping, he added.

“All I know at this time is that my son is back," Sajjad Ali Shah said.

Shah's kidnapping and rescue follows a number similar abductions in the region.

On May 10, Ali Haider Gilani, the son for former Prime Minister Yousuf Raza Gilani, was freed in Afghanistan in a joint U.S.-Afghan operation three years in captivity.

Two months earlier, Shahbaz Taseer, the son of a politician who was slain after being accused of blasphemy in Pakistan, was recovered near the Pakistani city of Quetta after more than four years in captivity.