Overthrowing Saddam Hussein was "the right decision", US President George W Bush said in a speech to mark the fifth anniversary of the invasion of Iraq.
He said the world was a better place because the US had acted.
Mr Bush spoke as anti-war protests were held in several US cities amid mounting opposition to the war and its costs.
Democratic Party presidential candidate Barack Obama said the decision to invade was made on ideological grounds, instead of "reason and facts".
In his speech, Mr Bush dismissed what he called "exaggerated estimates" of the war's price tag.
"The costs are necessary when we consider the cost of a strategic victory for our enemies in Iraq," he said.
He said recent troop reinforcements had "opened the door to a major strategic victory in the broader war on terror".
Mr Bush argued that fighting Islamic militants in Iraq helped to prevent attacks on targets in the US.
"The terrorists who murder the innocent in the streets of Baghdad want to murder the innocent in the streets of American cities," he said.
"Defeating this enemy in Iraq will make it less likely we will face this enemy here at home."
He also made the case that by working with Sunni Arabs from so-called Awakening Councils to defeat al-Qaeda, the US was successfully driving a wedge between militants and the Arab mainstream.
"In Iraq," he said, "we are witnessing the first large-scale Arab uprising against Osama Bin Laden. And the significance of this development cannot be overstated."
He made no reference to the fruitless search for weapons of mass destruction in Iraq - a major justification for launching the war.
As the president spoke, 32 people were arrested protesting in front of the Internal Revenue Service building in Washington.
The protesters were trying to draw attention to taxpayers' money funding the war.
"We wanted to put our bodies between the money and what that money goes to fund - the war, the occupation, the bombs," said Frida Berrigan from the War Resisters League.
Anti-war protests have also been planned for other American cities including New York, Miami, Chicago, Los Angeles and San Francisco.
Estimates of what the war has cost vary considerably. The non-partisan Congressional Budget Office estimates $600bn (£300bn) has been spent on the war so far, including this year's appropriations.
Nobel-prize winning economist Joseph Stiglitz calculates that the war will cost $3 trillion (£1.5 trillion) once health care for veterans and future economic losses are considered.
On the presidential election campaign trail, Democratic Party front-runner Barack Obama criticised the Bush administration's motives for launching the war.
"There was a president for whom ideology over-rode pragmatism and there were too many politicians in Washington who spent too little time reading the intelligence reports and too much time reading public opinion," he said in a speech in North Carolina.
Both he and his rival for the Democratic nomination, Hillary Clinton, have pledged to end the war.
Senator Obama voted against the invasion in 2002
On a campaign stop in Detroit, Michigan, Mrs Clinton repeated her promise to start withdrawing US troops from Iraq within 60 days of being elected president, saying it was time for Iraqis to take responsibility for their future.
"We have given them the precious gift of freedom and it is up to them to decide whether or not they will use it. We cannot win their civil war. There is no military solution."
Only the expected Republican Party nominee, John McCain, has continued to support the Bush administration policy in Iraq.
Meanwhile in Iraq, a female suicide bomber killed six people at a bus station in Balad Ruz in Diyala province, according to Iraqi police.
And near the northern city of Kirkuk, US troops shot dead three Iraqi policemen by mistake, an incident officials described as "a tragic accident, which was sincerely regretted".