Growing tension between Iraqis and occupying US troops in Baghdad has flared into violence, leaving two protesters and one US soldier dead.
The Iraqi soldiers were demanding unpaid wages
The US military says a soldier opened fire after demonstrators started throwing stones at a military convoy outside the former presidential compound which now houses the US-led military coalition running Iraq.
In a separate incident, a US soldier was killed and another wounded in a drive-by shooting at a petrol station in the city.
A US Army spokesmen said the gunmen escaped as other soldiers tried to help the wounded.
The presidential palace compound has been the target of frequent demonstrations as Iraqis protest in the searing heat about the lack of jobs and services in the chaotic post-war era.
Every day we come to protest peacefully, but it's useless - in the coming days it will not be peaceful
Essam Mansur Hussein
On Wednesday, hundreds of former Iraqi army soldiers were protesting that salaries had not been paid since the top US civil administrator in Iraq, Paul Bremer, officially dissolved the Iraqi army on 23 May.
The BBC's Chris Morris in Baghdad says that, while the US troops are still carrying out military operations, they are also trying to win "hearts and minds" - and incidents like this are likely to do enormous damage to their cause.
Lieutenant Colonel Richard Douglas said two men injured by the shooting at the demonstration had been taken to a medical facility for treatment but died later of their injuries.
The protesters, who had been chanting "Down, Down USA", said another two people had been wounded.
About 40 soldiers were holding back the crowd with bayonet-mounted rifles from behind razor-sharp concertina wire.
The US troops shot back after protesters threw stones
US Sergeant Brian Domell, at the scene, said there was no shooting until the protesters started throwing stones at troops on top of vehicles trying to get into the compound.
"They started picking up bigger rocks and throwing them at us," he said. "The guys on top of that vehicle returned fire."
The crowd also set upon a television crew and beat passing United Nations and television
vehicles with their shoes, witnesses said.
"Demonstrators began to scatter when the gunfire sounded," said AP photographer Victor Caivano.
"Newsmen also retreated under a hail of stones."
Raad Mohammed, a low-ranking former Iraqi army officer who joined the protest for unpaid back wages, said his friend had been shot in the right shoulder.
His own shirt was stained with what he said was his friend's blood.
Mr Mohammed said he and others had been about to put the wounded man in a car when American troops approached and said, "We'll take care of him" and took him inside the compound.
Another protester Essam Mansur Hussein, an officer under the ousted regime, said they were now prepared to take up arms against US troops occupying the city.
"Every day we come to protest peacefully, but it's useless. In the coming days it will not be peaceful," he said.
"They have to realise that if we have nothing to eat there will be Feyadeen (militia) operations every day.
"We will blow them up one by one until they either leave or are all dead."
The demonstration took place as US troops intensified their searches in the capital for illegal weapons and supporters of Saddam Hussein's regime.
The military says about 400 people have been arrested since the latest operation, dubbed Desert Scorpion, began on Sunday.
The searches have aroused widespread resentment, despite what the military says are efforts to show sensitivity without endangering the soldiers.
Our correspondent says that despite ugly scenes on Wednesday, the picture in Baghdad is mixed, with some people delighted that Saddam Hussein has gone and services and facilities gradually returning.
But he says that among the people unhappy with the continuing US military presence in Iraq are some who are prepared to take up arms and fight.