(CNN) -- U.S. military forces landed at a compound in Pakistan to battle targets linked to recent attacks on U.S. troops in Afghanistan, a senior U.S. official confirmed Wednesday.
Security in the South Waziristan area of Pakistan has deteriorated in recent years.
The official declined to be identified, citing the extreme sensitivity of U.S. forces operating within Pakistan's borders.
The action was an uncommon one for the U.S. military. Generally, NATO forces do not enter Pakistan except when pursuing insurgents in Afghanistan who slipped over the border or, in an extreme case, to pursue a high-value target.
The Pentagon has refused to comment officially on the attack, but several defense officials acknowledged that U.S. military activity had taken place inside Pakistan.
The senior U.S. official said a small number of U.S. helicopters landed troops in the village near Angoor Adda in South Waziristan, where Taliban and al Qaeda fighters have hunkered down over the years.
Local media reports said the troops came out of a chopper and fired on civilians. The U.S. official said there may have been a small number of women and children in the immediate vicinity, but when the mission began "everybody came out firing" from the compound.
He said the U.S. troops specifically attacked three buildings in the compound. They were believed to contain individuals responsible for training and equipping insurgents who have been crossing the border into Afghanistan in increasing numbers in recent months and staging large-scale, high-profile attacks against U.S. and coalition forces.
The official could not say if the troops were going after a specific individual. Officials told CNN there was no indication the target was Osama bin Laden or his deputy, Ayman al-Zawahiri.
Pakistan's Foreign Ministry on Wednesday lodged a protest against U.S.-led coalition and NATO forces for what it said was a "helicopter-borne ground attack" from Afghanistan into Pakistan, an uncommon tactic in the coalition's fight against militants along the violent border.
The coalition and NATO have been seeking a way to effectively battle militants launching attacks from Pakistan's swath of tribal areas along the border. They have become frustrated with Pakistan over the years, saying it is not being proactive enough against militants, a claim denied by Pakistan -- now in political flux after the resignation of President Pervez Musharraf.
Top U.S. and Pakistani military officials last week met on an aircraft carrier regarding American concerns that Pakistan hasn't been cracking down hard enough on the Taliban.
Several times this year, U.S.-operated drone aircraft launched attacks inside Pakistan
The Pakistani Foreign Ministry described the strike as "a helicopter-borne ground attack supported by air assets based in Afghanistan" and called it a "gross violation of Pakistan territory."
Pakistani officials were still counting the casualties. One local official said the raid left 20 civilians dead. Pakistan military spokesman Maj. Gen. Athar Abbas said seven civilians died and others were critically injured.
"It is, indeed, most unfortunate that coalition/ISAF in Afghanistan have resorted to cross-border use of force against civilians," the Pakistan Foreign Ministry said in a written statement. ISAF is NATO's International Security Assistance Force.
Pakistan's Foreign Ministry spokesman said the U.S. ambassador to Pakistan was summoned to provide an explanation of the incident.
"Such actions are counterproductive and certainly do not help our joint efforts to fight terrorism," the ministry said. "On the contrary, they undermine the very basis of cooperation and may fuel the fire of hatred and violence that we are trying to extinguish. Moreover, any attack on Pakistani territory is unacceptable and constitutes a grave provocation."
Owais Ahmed Ghani, the administrative head of Pakistan's Federally Administered Tribal Areas, called the strike "a direct assault on the sovereignty of Pakistan. And the people of Pakistan expect that the Armed Forces of Pakistan would rise to defend the sovereignty of the country and give a befitting reply to all such attacks."