Geo News reported the soldiers, who had been abducted Thursday in Peshawar, were shot to death and their bodies dumped in the Hasan Khel area. Two other soldiers survived, Press TV reported.
Political officials and members of local Jirga were sent to retrieve the bodies, which were identified, and the soldiers' families were notified, Geo News said.
Iran's Press TV reported Gul Shehzad, a government official, said Tehrik-i-Taliban Pakistan took responsibility for the killings.
"We found 21 bullet riddled bodies of security personnel a short while ago in an uninhabited area," local government official Naveed Akbar said.
"One was found alive but wounded and admitted to hospital while another managed to escape unhurt."
Shehzad said the soldiers' hands were tied with rope before they were shot.
The News International reported about 400 militants had stormed the two security posts.
2014: NFL Cheerleaders [PHOTOS]
Syrian Al Qaida group executes Lebanese soldier