About 30 U.S. special operations soldiers were on a reconnaissance patrol north of Asadabad in Kunar province Monday afternoon when they were fired upon with light machine guns and rifles, said Col. Roger King.
The U.S. troops returned fire, and found two dead attackers when they reached the top of the hill, King said.
He said the Americans didn't know if there had been more than two attackers. He said there were no U.S. or civilian casualties.
It was the latest attack against the U.S. military in Afghanistan. On July 27, five American soldiers were wounded when at least six people fired on them and threw grenades.
U.S. troops have been searching parts of the country for Taliban and al Qaeda holdouts. King said the patrols also help keep local crime down.
Meanwhile, fighters of a warlord trying to control parts of southeastern Afghanistan held their ground after President Hamid Karzai's government warned it would take action unless they submit to central authority, local officials reported.
Another area commander said his men were "ready to attack" the warlord's forces at a signal from Karzai.
Bacha Khan Zadran's gunmen, who have allied themselves with U.S. troops in past military operations, have sought to assert control over parts of the region in defiance of governors appointed by Karzai's seven-month-old transitional government.
The area is one of several flashpoints where local armed factions are vying for power in outlying areas of Afghanistan and is also one of the most active fronts in the U.S.-led war against al Qaeda and the Taliban.