Pakistan's army retaliated with helicopter gunships and artillery after pro-Taliban tribesmen clashed with security forces Saturday near the Afghan border. At least 49 people were killed in the fighting, a spokesman said.

Anger has been stirring among the tribesmen since a military strike on a suspected Al Qaeda camp earlier this week in the nearby village of Saidgi.

Maj. Gen. Shaukat Sultan, the army spokesman, said 25 militants were killed in Miran Shah and 21 in Mir Ali, but he added the toll could be higher. Three government troops also died and about 10 were wounded, he said.

An intelligence official in the area said a fourth soldier was killed late Saturday in Miran Shah, and the body of a fifth was found in Mir Ali on Sunday. The fighting petered out early Sunday, the official said on condition of anonymity because of the secretive nature of his job.

Intercepts of radio communications between militants involved in the fighting in the towns of Miran Shah and Mir Ali in North Waziristan tribal region suggested 80 or more fighters had died, security and intelligence officials said on condition of anonymity because they weren't authorized to comment to media.

The violence came as President Bush visited the capital, Islamabad, about 190 miles to the northeast, and voiced solidarity with Pakistan's President Gen. Pervez Musharraf in fighting terrorism.

Pakistan has deployed about 80,000 troops along the Afghan frontier but has failed to establish government control in tribal regions that have resisted outside influence for centuries.

Waziristan is known as a hotbed of Al Qaeda and Taliban militants who draw support from the local Pashtun tribal people. Many of the rebellious tribesmen involved in Saturday's unrest were believed to be Islamic students who are sympathetic with the hard-line Taliban militia.

Military officials said 45 people, including foreign militants, were killed in Wednesday's attack by helicopter gunships and ground forces on Saidgi, about 10 miles from Miran Shah. The tribesmen claim local people died in the attack.

Saturday's fighting began in Mir Ali, when tribesmen opened fire on vehicles carrying paramilitary rangers, an army officer said.

The fighting spread to nearby Miran Shah, where about 500 tribesmen traded fire with paramilitary forces in the bazaar and, according to security officials, occupied some government buildings. Both sides could be seen firing mortars and assault rifles. Some mortar shells hit closed shops.

Soon after the clashes started, phone lines to the town went dead.

The army spokesman said the tribesmen started firing rockets at a Frontiers Corps base in Miran Shah and the army responded with artillery fire. Officials said helicopter gunships also targeted the tribal fighters' positions.

"We think about 25 militants have been killed. It could be higher," Sultan said.

A senior intelligence official, who declined to be identified, said the army had destroyed a hotel in Miran Shah bazaar that the tribal militants had used as a position for firing rockets.

Sultan said the militants were led by a local cleric Maulvi Abdul Khaliq, who this week called for a jihad, or holy war, against Pakistan's army.

Earlier Saturday, Khaliq had demanded that authorities stop killing "innocent" people in military operations and urged local elders, in an announcement broadcast from mosques and loudspeakers mounted on pickup trucks, to stop contact with the local government as a protest against the Saidgi operation.

Bazaars and government offices closed after the announcement and 500 families left town fearing a showdown, said a local intelligence official, who declined to be named because he is not authorized to comment.

Another official in the town said many families had left in haste, without packing many belongings.