Scores of Taliban fighters were killed Tuesday evening as they attempted to storm a small U.S. outpost along the Pakistani border and were driven back by American soldiers, according to U.S. military officials in the province.

The insurgents launched the attack by firing rocket-propelled grenades and rifles from the grounds of two Islamic schools near Combat Outpost Margah, in eastern Afghanistan’s volatile Paktika province. The company of American soldiers stationed there fired back as large groups of fighters moved toward the base from a wadi, or valley, to the west, U.S. military officials said.

The fighting lasted less than two hours, ending by about 8:30 p.m. No U.S. troops were killed. A spokesman for the Paktika governor said that 50 to 60 insurgents were killed.

The U.S. outpost has become a favorite target for Haqqani network insurgents based in Pakistan, who exploit the porous border to attack Americans. It was at least the third major attack on the base in a little more than a year.

In October 2010, about 100 fighters managed to overrun an observation post that looked down on the base. Many of them were killed by bombs from U.S. aircraft, American military officials said. On Oct. 7 this year, insurgents fired 111 rockets and mortar rounds at the outpost and dispatched a suicide bomber toward it in a truck rigged with explosives. The truck was disabled by U.S. gunfire before it could get to the gate.

“It’s a base the insurgents generally don’t like,” Col. Edward T. Bohnemann, the U.S. brigade commander, said in an interview this month. “It’s four kilometers from the border. It’s in an area that has not been openly friendly to [the Afghan government] ever.”

The massing of large groups of insurgents to assault U.S. positions has grown increasingly rare in Afghanistan this year, as the Taliban resorts to safer guerrilla tactics to take on U.S. and Afghan forces.

In Paktika, insurgents along the border typically fire rockets and mortar rounds at U.S. bases, while the western part of the province experiences more roadside bombings.

When insurgents do fight in a group, they tend to suffer heavy casualties over a short period because they lack the firepower of U.S. troops.

On July 20, U.S. Special Operations troops found a group of insurgents who had stashed weapons in a cave overlooking a wadi in Paktika’s Sar Howsa district. Wave after wave of fighters came at the coalition troops, until more than 100 of the insurgents had been killed, according to U.S. military officials. One American soldier died.

“If they’re planning a massive attack, they may be able to muster a group of 100 around there,” Maj. Eric Butler, the brigade’s intelligence officer, said in an interview last week. For the Taliban, he said, “usually it ends very, very badly.”