Some 15 soldiers were also injured during the operation in Azam Warsak area of South Waziristan, said the official statement issued in Peshawar.
"Paramilitary forces surrounded certain houses during which the foreign element with the help of their local harbourers fired on the soldiers with heavy and light weapons resulting in the death of eight soldiers and wounding 15 others," the statement said.
"It is believed that more than 24 foreign people and their local companions were killed in this encounter. Two of the dead bodies are taken into custody."
The statement did not explain where the remaining bodies were.
Tuesday's drive, unleashed by the paramilitary Frontier Corps near the South Waziristan district capital Wana - 20 kilometres from Afghan border - targeted "miscreants", Inter Services Public Relations (ISPR) Director General Major General Shaukat Sultan said.
He said paramilitary forces were conducting routine operation against the suspected terrorists.
"In the light of a tip-off that some foreigners and terrorists are present in the western part of Wana, a search operation was started on Tuesday morning by the paramilitary forces," the DG ISPR told PTV.
"Let me make it clear that it is a routine search operation, which the paramilitary forces have been conducting in the past also," he added.
During the operation when paramilitary forces reached the spot where, according to the information, some suspected miscreants were hiding, an exchange of fire took place between them and the personnel of law enforcing agencies, he said.
He said, "according to the latest information, the firing has been held now and negotiation is going on between the miscreants, local tribal chiefs, including the political agent, and the paramilitary forces."
Asked what is the number of these people, the ISPR DG said, "it is not possible at present to say anything in this regard."
Azam Warsak was the scene of a bloody clash between Al-Qaeda fighters and troops in June 2002.
Officials earlier said the terrorists dug themselves in and fought a pitched battle with the paramilitary soldiers.
The latest operation, the fourth since October, follows President Musharraf's appeal on Monday to "500 to 600 foreigners" hiding in the tribal belt to surrender.
The clash came a day after US Secretary of State Colin Powell urged Pakistan to step up efforts to capture terrorists near the border, and on the eve of his visit to Islamabad for talks on hunting Al-Qaeda and its chief Osama bin Laden.