Pakistani forces clashed with heavily armed foreign militants Wednesday, killing more than 20 people, in a mountainous tribal region near the Afghan border where hundreds of Al Qaeda (search) fighters are believed to be hiding, officials and a tribal elder said.

The bloodshed follows weeks of failed efforts to get the militants in South Waziristan to surrender to authorities by peaceful means after an army counterterrorism offensive in March that left 120 people dead.

Brig. Mahmood Shah, chief of security for Pakistan's (search) tribal regions, said foreigners and local tribesmen had been holed up in four fortress-like houses, about 40 kilometers (25 miles) from the Afghan frontier. He said they traded fire with paramilitary and army soldiers who had surrounded the area.

He said about 20 foreign militants and one paramilitary soldier had been killed, and three civilians had died in the crossfire.

"The intermittent shooting continued until 4:30 p.m. and then finally it stopped. According to our information up to 20 foreigners have been killed. We have bodies of several of them. One injured is also with us," Shah told the private Geo television network.

He said seven of the dead had already been buried, but others were lying ravines and could not be recovered.

Earlier, an army statement said the bodies of at least eight militants, some of them foreigners, had been retrieved and one wounded militant captured. The security forces suffered a few casualties, it said without elaborating.

Officials gave no information about the nationalities and the identities of those killed and captured in the clash in the Ghat Ghar area, about 30 kilometers (20 miles) west of Wana, the main town in South Waziristan.

Pakistan's tribal areas bordering Afghanistan are a possible hideout for Usama bin Laden (search) and his chief aide, Ayman al-Zawahiri. There was no immediate indication that top Al Qaeda figures were among those involved in the clash.

Alam Khan Wazir, a tribal elder in Wana, said two civilians — a man and a woman — were killed in the crossfire when a mortar shell hit their house in Nikrankhel village. Two girls inside were wounded. The victims were from the same family.

"The fighting is going on. We're afraid that many people are killed," he said.

Tension has been building in South Waziristan over the past month as authorities have pressured tribesmen to evict hundreds of Central Asian, Arab and Afghan militants, many of whom moved there from Afghanistan after the fall of the Taliban regime in late 2001.

The militants have refused to register with authorities despite a government amnesty offer that would allow them to settle in Pakistan if they renounce terrorism and abide by national laws.

The army, and its leader President Gen. Pervez Musharraf — a key U.S. ally in its war on terrorism -- have repeatedly warned that another military operation could be launched unless the foreign militants give themselves up.

The government has already imposed economic punishments on local tribesmen, by blockading Wana and closing the bazaar.

To appease authorities, tribesmen raised a 4,000-strong force. The force had been hunting for foreigners since Monday, without any success, until it abruptly stopped work as the hostilities began.

Officials said the clash began early Wednesday, when two military posts and a camp came under rocket and mortar fire. The military returned fire and soldiers were sent to areas that appeared to be the source of the attack.