Taliban militants have released a Chinese engineer six months after he was abducted in violence-wracked northwest Pakistan, security officials said Sunday.

Militants abducted two Chinese men who had been checking a Pakistani telecommunications installation in the area, bordering Afghanistan, on August 29.

Both men tried to escape in October. One managed to find his way to an army post while the other was recaptured after injuring his leg falling down a steep mountain slope.

The man was released on late Saturday and shifted to Peshawar, a security official said.

Another official, who requested anonymity, said the Chinese engineer was unwell. He gave no details and the Pakistan foreign ministry did not immediately comment.

A Taliban spokesman in the troubled Swat valley, Muslim Khan, said the engineer had been freed as a "goodwill gesture".

"He was handed over to local administration officials in Barikot town of the Swat valley", Khan told reporters.

The state run Associated Press of Pakistan news agency quoted the Chinese embassy as saying later that the Chinese engineer, Long Xiaowei, was released on Saturday and he has safely reached the Chinese embassy. He will go back to China soon to join his family, it said.

"This embassy along with Mr Long wishes to express sincere thanks to the efforts by relative departments of Pakistan for his safe release," a Chinese embassy statement said.

Islamic militants have in the past targeted Chinese workers in Pakistan. China is one of Islamabad's closest allies as well as its largest arms supplier.

Security forces in mountainous Swat, a former tourist region, have been battling pro-Taliban militants who want to enforce Islamic Sharia law in the region.