Pakistani troops backed by missile-firing helicopters killed an estimated 80 militants Monday after destroying a purported Al Qaeda-linked training facility near the Afghan border, the military said.

The pre-dawn attack targeted a religious school — known as a madrassa — in Chingai village near Khar, the main town in the Bajur tribal district, said army spokesman Maj. Gen. Shaukat Sultan.

Sultan said initial estimates, based on intelligence sources on the ground, indicate the missile attack killed about 80 suspected militants from Pakistan and other countries. It was not immediately possible to independently verify the number.

"These militants were involved in actions inside Pakistan and probably in Afghanistan," Sultan told The Associated Press.

The raid sparked angry protests in Chingai, Khar and other Bajur towns as local tribesmen and political leaders denounced the military, saying innocent civilians — not terrorists — were killed.

The bodies of 20 tribesmen killed in the attack were lined in a field near the madrassa before an impromptu burial attended by thousands of angry locals, according to an AP reporter at the scene.

At the madrassa, dozens of villagers collected the remains of another 30 bodies from the rubble of the building, placing the mutilated body parts into large plastic bags normally used to hold fertilizer.

Thousands of people traveled from nearby villages to inspect the destroyed madrassa, some crying and others chanting "Long live Islam." The blast leveled the building, tearing mattresses and scattering Islamic books, including copies of the Quran.

Pakistan's military has been trying to stamp out pro-Al Qaeda and Taliban terrorists operating inside this semiautonomous tribal-dominated region and against U.S. and Afghan forces across the poorly marked frontier in Afghanistan, where Al Qaeda leader Usama bin Laden is believed to be at large.

The remote Bajur region borders Afghanistan's volatile Kunar province and militant groups are believed to routinely smuggle fighters, weapons and supplies across the frontier.

Among the dead was Liaquat Hussain, a local Islamic cleric who ran the madrassa and is believed to have been sheltering Al Qaeda militants, and several of his aides, locals said.

Siraj ul-Haq, a Cabinet minister from the North West Frontier Province, condemned the attack and announced he would resign from the government in protest.

"The government has launched an attack during the night, which is against Islam and the traditions of the area," ul-Haq told the AP during the funeral. "They (the victims) were not given any warning. This was an unprovoked attack on a madrassa. They were innocent people."

Sultan said the military had warned Hussain to close his madrassa, which the army believed was being used as an Al Qaeda-linked training center to prepare militants for attacks in Pakistan and Afghanistan.

Visit FOXNews.com's Afghanistan Center for complete coverage.