The number of Iraqis killed by US forces in the central city of Samarra has risen to 54, the US military says.

It initially reported 46 dead and 18 wounded in the fighting that raged as militants attacked convoys on Sunday.

Witnesses said eight of the dead were civilians - caught in the worst battle involving US troops since major combat operations were declared over on 1 May.

South Korea and Spain have both said their troops will remain in Iraq, despite losses in weekend ambushes.

US spokesman Lieutenant Colonel William MacDonald said that US forces had fought back with tank fire when they were attacked three times by militants wearing uniforms of the pro-Saddam Fedayeen fighters.

American forces destroyed three buildings being used by insurgents, he said.

"We're sending a clear message that anyone who attempts to attack our convoys will pay the price," the spokesman said.

Samarra is within the so-called "Sunni triangle" north of Baghdad - the heartland of Saddam Hussein loyalists.

'Rooftops and alleys'

Two logistical convoys were moving into Samarra when they came under attack from roadside bombs, small arms, mortars and rocket-propelled grenades, Colonel MacDonald said.

The attacks - one on the east side of the city, the other on the west - were simultaneous and appeared to be co-ordinated.

In one of the ambushes, militants had barricaded off the road and opened fire from rooftop positions and out of alleyways.

About an hour after the initial ambushes, four militants in a car attacked another US convoy in Samarra.

All four were wounded and captured in the clash and Kalashnikov rifles recovered from the black BMW.

None of the US soldiers was seriously hurt, the US spokesman said.

"This is the largest [ambush] for our task force since we've been in the area," Colonel MacDonald added.

Frightened witnesses in Samarra told a correspondent for the French news agency AFP who managed to enter the city that US forces had repeatedly come under attack on Sunday.

However, they added that, in the aftermath of one attack at about 1255 (0955 GMT), an American tank had opened fire on workers leaving a factory at the end of their shift, killing two and wounding "many".

Iraqi doctors said eight civilians were killed by US fire in the exchanges, reported AFP.

The BBC's Peter Greste, also in Samarra, says there is an unmistakeable sense of anger among local people - who say the US response to the attacks was indiscriminate and unnecessary.

Bloody weekend

South Korea, Spain and Japan have all vowed not to surrender to "terrorism" after weekend attacks on their citizens in Iraq.

Seven Spanish intelligence agents were killed in an ambush on Saturday and two Japanese diplomats died in a separate attack.

The US says it faced uniformed pro-Saddam militants

The attack on the Spanish agents caused particular revulsion in Spain where images of Iraqis celebrating at the site of the killings were shown widely.

Two South Korean workers and a Colombian contractor were also killed in separate attacks and two US soldiers died in an attack near the Syrian border.