Chancellor Gordon Brown has admitted the government has made mistakes over its handling of the situation in Iraq.
Gordon Brown was quizzed over Iraq and Iran at the meeting
Speaking at a Labour Party hustings meeting in Bristol, Mr Brown said it was a divisive issue for the nation.
He said the government and others had fallen short when it came to rebuilding Iraq's economy after the war.
Mr Brown, who becomes PM on 27 June, said economic activity, employment and security were key to achieving peace.
He spoke candidly about the government's failures in Iraq during a Labour question and answer session with trade unionists at the meeting.
Mr Brown said: "There's massive unemployment in Iraq and that is a failure on our part, a failure on the part of those who've been in Iraq, that there is still so much economic deprivation and people are not in jobs."
Mr Brown said developing the economy and political system in Iraq was key.
"I see the next stage as us getting to a position where there is security, so our troops can move to an "overwatch position", getting economic development so that people have jobs and have got economic prosperity.
"And getting the political system sorted out so a democracy is fully functioning. Let us not deny that this has been a divisive issue."
Speaking later at the Hay Festival, in mid Wales, he said he took "collective responsibility" for the decision to go to war with Iraq and reiterated that it had "clearly divided the country."
Earlier in Bristol he was asked if he could rule out military action over Iran.
Mr Brown said multilateral action and economic sanctions were the best ways to deal with the situation.
The chancellor, who has not previously elaborated on his view that sanctions against Iran were working, said: "We want a peaceful settlement to the Iran issue."
It was "totally wrong" for countries to defy the international community and to start stockpiling nuclear weapons, he added.
"What we don't want is a situation where we move from North Korea to Iran to African countries, where we have no control. I think multilateral pressure is the right thing to do."
The government has been careful not to give unequivocal assurances since former Foreign Secretary Jack Straw said military action was "inconceivable" in November 2004.
Suggestions that US anger over his stance contributed to his removal from the job in a reshuffle last year were strongly denied.
In February Mr Blair said that diplomacy, not military action, was the best way to resolve the stand-off over Iran's nuclear programme.
He told the BBC he was not aware of any plans to attack Iran and said the only viable solution was a political one.
But he said he could not "absolutely predict every set of circumstances".
Conservative leader David Cameron warned earlier this week that although military action could have devastating consequences, it should not be ruled out.
The UN Security Council has passed a resolution demanding that Iran suspends all enrichment activities.
The UN's nuclear watchdog, the International Atomic Energy Agency (IAEA), said in a report on Wednesday that Tehran was stepping up enrichment and obstructing inspections.
Mohamed ElBaradei, the head of he IAEA, said it might be too late to stop Iran entirely and the focus should be on preventing large-scale enrichment - a policy rejected by US and UK diplomats.
Iranian President Mahmoud Ahmadinejad says Iran will not be deterred from pursuing its nuclear goals and insists that it is co-operating with the IAEA.
Relations between the UK and Iran hit a low point when 15 Royal Navy personnel based on HMS Cornwall were seized by Iranian Revolutionary Guards on 23 March in the northern Gulf.