An official says a Chinese engineer held captive by militants for six months in Pakistan has been set free and is safe.

The announcement is a bit of good news following the apparent beheading of a Polish engineer by Taliban militants in Pakistan and threats to kill an abducted American.

Yao Jing, the deputy head of China's mission in Islamabad, said Long Xiaowei was set free Saturday.

Chinese state-run Xinhua news service reported that Long arrived at the Chinese embassy in Islamabad early Sunday and met with the ambassador.

Long was kidnapped last August. A Pakistani Taliban spokesman also confirmed his release.