US President George W Bush has returned home after a surprise trip to Baghdad - his first since November 2003.
Iraq's Prime Minister Nouri Maliki was only given a five-minute warning before meeting the guest for talks at the US embassy in the fortified Green Zone.
"Iraq's future is in your hands," Mr Bush told the Iraqi prime minister.
The American president had been chairing talks in the US on future policy in Iraq and had been due to speak to Mr Maliki via videophone.
Correspondents say the trip comes amid a rare mood of optimism in the White House about events in Iraq.
Last week saw the killing of the leader of al-Qaeda in Iraq, Abu Musab al-Zarqawi, and the appointment of ministers in the Iraqi government for defence, security and the interior.
The Bush administration sees these developments as real progress and hopes they will buttress the credibility of Iraq's new government, the BBC's Adam Brookes in Washington says.
But in further unrest, at least 16 people have been killed in a wave of blasts in the northern city of Kirkuk.
In other developments:
- The new leader of al-Qaeda in Iraq, Abu Hamza al-Muhajir, has reportedly vowed to defeat "crusaders and Shias" in Iraq, according to an internet statement
- The judge in the trial of ousted Iraqi leader Saddam Hussein brings to an end the defence phase
- A new USA Today/Gallup Poll shows 48% of Americans say they believe the US could probably or definitely win the war in Iraq, up from 39% in April.
At Baghdad airport Mr Bush boarded a helicopter for the short trip to the US embassy.
The leaders discussed the next steps for Iraq in talks with their advisers and the Iraqi Cabinet.
Mr Bush told reporters afterwards that Iraq was part of the US "war on terror" and would continue to receive Washington's support.
"When America gives its word, it will keep its word," he said. "It's in our interest that Iraq succeeds."
For his part, Mr Maliki said he hoped the suffering of Iraq would come to an end and all foreign troops would return home.
Mr Bush also thanked the US military for their "sacrifice" during his visit.
He travelled to Baghdad amid the same exceptional security and secrecy that surrounded his trip to meet US troops in November 2003.
Most foreign leaders have made their visits to Iraq unannounced because of the security threats.
The trip came as Mr Maliki launched a security crackdown in Baghdad to try to build momentum following the death of Zarqawi in a US air strike.
The Kirkuk bomb blasts claimed at least 16 lives
Measures include a curfew from 2100-0600 and a ban on all vehicle traffic on Friday lunchtimes to try to curb attacks during Friday prayers.
Earlier on Tuesday a wave of car bomb attacks claimed at least 16 lives in Kirkuk.
Correspondents say the concern is these attacks are part of the revenge promised by al-Qaeda in Iraq for the death of Zarqawi.
Mr Bush has pledged that the group's new leader will be "brought to justice".