The shootout on Wednesday occurred shortly after the soldiers were killed by a land mine near the Pir Koh gas fields, about 400km east of Quetta, the capital of southwestern Baluchistan province, said Abdul Samad Lasi, the region's police chief.
"I confirm that 12 terrorists were killed by our forces, and some others managed to escape," Lasi said. Three government soldiers were also wounded in the initial land mine explosion.
The Baluchistan Liberation Army - a group fighting for the rights of Baluchistan - claimed responsibility shortly after the attack, according to Mirak Baluch, a purported spokesman.
"Yes, we are responsible for it. We will do more attacks in the future," he told The Associated Press by phone from an undisclosed location.
In recent weeks, Pakistani army helicopters and ground troops have raided training bases used by tribesmen suspected in attacks against the government in impoverished, sparsely populated Baluchistan, which borders Afghanistan and Iran.
The region is home to Pakistan's biggest natural gas fields, and tribesmen in the area want more royalty payments from the central government for resources extracted from the area.
They also oppose government plans to build new military garrisons there. The government says the new garrisons are needed to bolster security.
On Saturday, tribesmen fired 18 rockets in Baluchistan. One hit a home, killing a 4-year-old child and wounding his brother and mother.
Tension has been high in the province since suspected Baluch tribesmen fired rockets at Kohlu last month while President General Pervez Musharraf was visiting.
Armed groups have targeted security forces, railroads, oil and gas fields and other government installations. Tribal leaders meanwhile claim scores of people have been killed in military operations to quell the unrest since December.
The recent violence has raised fears of a repeat of an uprising that rocked Baluchistan in the 1970s, when thousands died in a large-scale military operation against rebellious tribesmen.