Intelligence officials say the Taliban have beheaded two Pakistani soldiers and hung their heads from wooden poles in a town in the country's northwest.

A Pakistani Taliban commander says militants seized the two men on Sunday night when the army raided two houses in Miran Shah, the main town in the North Waziristan tribal area.

The military operation followed a militant ambush on a security checkpoint in Miran Shah earlier Sunday that killed nine soldiers.

The intelligence officials did not specify how the soldiers were seized, but confirmed that their heads were hanging from poles in two different parts of Miran Shah.

The officials and the Taliban commander spoke on condition of anonymity on Monday because they were not authorized to talk to the media.