The statement said that US and Afghan forces received intelligence about "enemy activity" involving an estimated 40 Taliban fighters following a brief earlier engagement in which three men were arrested.
"After manoeuvring to gain contact with the enemy force, US special forces requested coalition air support to engage the Taliban fighters as they were attempting to establish ambush positions," the statement said.
"Approximately 24 Taliban fighters were killed and four vehicles destroyed during the prolonged seven-hour battle."
The two soldiers whose names and nationalities were not revealed were treated in a nearby medical facility where they were in a stable condition, the statement said.
In western Herat province, US special forces and Afghan troops clashed with fighters disguised as police officers manning a checkpoint, leaving three suspected militants dead, the coalition said on Thursday.
The men, wearing fake police uniforms, opened fire on the troops as they approached the illegal checkpoint in Shindand district on Wednesday, the coalition said in a statement.
The patrol returned fire, killing three and wounding another three, it said.
Troops have confiscated more than 100 fake uniforms and more than a dozen false identification documents in Herat province since Tuesday, the coalition said.