The dead soldiers included one Canadian and one American.
The battle in Helmand province's Sangin district on Wednesday also wounded three Canadian soldiers, Canadian Brigadier-General David Fraser said at a base in southern Kandahar city.
The fighting was the deadliest in months and highlights the threat insurgents still pose four years after the Taliban was ousted.
It was not immediately clear if the violence was linked to the drug trade. Helmand is Afghanistan's main opium poppy-growing region and there have been fears of widespread violence since an aggressive poppy eradication campaign began in recent weeks.
In other violence, suspected Taliban fighters attacked a police checkpoint in Kandahar late on Tuesday, killing two officers and wounding four, Afghan police commander Abdul Nazik said.
He said the insurgents had tried to occupy the police post, but were forced to flee.
Another suspected Taliban fighter was killed in a separate incident in southern Afghanistan's Zabul province when a bomb he was placing on a roadside blew up prematurely, police chief Ghulam Nabi Malakhail said.
On Wednesday, multinational forces killed 12 fighters in the initial attack on the base in Sangin, while another 20 insurgents were killed as they fled, a US military statement said.
Two buildings at a Taliban compound were later destroyed in the attack, which was supported by warplanes.
The US-led multinational force is
deployed in the south and east
Large caches of weapons, bombs and ammunition were discovered at the Taliban compound. All were blown up, "causing multiple secondary explosions and destroying the compound and all enemy military equipment inside", the US military said.
"The capturing of these two compounds with boots on the ground produced significant intelligence and allows us to continue to put pressure on the enemy," US Brigadier-General Anthony J Tata.
The US military said one of the slain coalition soldiers was American, but did not identify him, pending notification of next of kin. Fraser said the slain Canadian was Private Robert Costall of the 1st Battalion of the Princess Patricia's Canadian Light Infantry, based in Edmonton.
The wounded soldiers were sent for treatment to a base in Kandahar, the main city in southern Afghanistan.
The US has about 19,000 troops in the coalition based mainly in the insurgency-hit south and east to root out Taliban and al-Qaida fighters.
Canada deployed 2300 troops to southern Kandahar province last month and took command of the coalition forces in the province, the birthplace of the Taliban.
About 3500 British troops are due to deploy to Helmand in the coming weeks. The first of the soldiers, including engineers, are already on the ground to prepare for the arrival of the main force.