One US soldier was wounded in the clash on Saturday night, said Lieutenant Cindy Moore.
"Four insurgents crossed into Afghanistan from Pakistan and attacked a US patrol with small-arms fire," Moore said.
A US war plane attacked the four and eight of their comrades as they fled back towards the nearby border with Pakistan, she said. The twelve were reported killed.
An Afghan provincial official said the armed men were Taliban.
However, Aljazeera's correspondent in Islamabad reported a differing account of the incident.
He quoted Pakistani tribal sources as saying that five Pakistani civilians were killed on Saturday night in a US air strike, targeting the Lowara Mindi area near the Afghan border.
The US strike came in response to a rocket attack, thought to have been launched from Pakistani areas, targeting a US military camp.
The correspondent added that the rocket attack killed and injured an unidentified number of US soldiers.
Afghan government and US military accusations that Taliban and other Islamic fighters are able to operate from Pakistan have angered Islamabad, which is a key US ally.
"This was a coordinated effort between coalition forces and the Pakistani military"
Lieutenant Cindy Moore,
US military spokesman
US military spokesman Moore said Pakistani border forces had cooperated with US forces in their pursuit of the fighters.
"This was a coordinated effort between coalition forces and the Pakistani military," she said.
A rash of bloody clashes in recent weeks has dashed US and Afghan government hopes that the Taliban might be running out of recruits and resources.
But the US military says the fighters are getting weaker.
It attributes the recent clashes to more aggressive patrolling by US-led and Afghan government troops.