The 22-year-old was to serve with his Blues and Royals regiment in the coming weeks as part of the latest British troop rotation.
The prince had repeatedly said he wanted to be deployed with his men.
Dannatt said he knew that Harry, as a dedicated professional soldier, would be greatly disappointed by the news, but said the risks outweighed those considerations.
He said: "There have been a number of specific threats, some reported some not reported, which relate directly to Prince Harry as an individual."
"These threats expose not only him but also those around him to a degree of risk that I now deem unacceptable."
In a statement released on behalf of Harry by Clarence House, the prince said he was "very disappointed" but would not quit the army as a result.
He said he fully understood the decision taken by Dannatt.
Cornet Wales, as Harry is referred to in the army, has long said he enrolled at Sandhurst military academy, where officers are trained, because he wanted to serve on the front line.
As a junior commander in the Blues and Royals "A" squadron Harry would have patrolled Basra and the deserts north and west of the city in a Scimitar light reconnaissance tank.
Scimitar squadrons operating in the area have repeatedly come under attack in recent weeks.
Among the dozen British soldiers killed in Iraq in April, two were blown up when a Scimitar vehicle was hit by a roadside bomb.
Dannatt said the widespread knowledge about Harry's impending deployment had contributed to his decision.
He said: "It is a fact that this close scrutiny has exacerbated the situation and this is something that I wish to avoid in the future."