Gates, on his third visit to Iraq since taking office, said he had spoken to Nuri al-Maliki, the prime minister, who is a Shia, about "reaching out to the Sunnis" to end the bloodletting that has killed tens of thousands of Iraqis.
Also on Friday, it was announced in Washington that Condoleezza Rice, the US secretary of state, would attend a global conference on Iraq in Egypt next month.
Sean McCormack, the department spokesman, said Rice would "discuss ways to support Iraq in its economic reform efforts and move forward with the stabilisation of Iraq and transition to full Iraqi self reliance."
He said she might meet her counterparts from Iran and Syria, countries Washington accuses of backing anti-US fighters in Iraq, as well as US-designated "terrorist" groups elsewhere in the Middle East.
Meanwhile, George Bush, the US president, has defended the Iraq security plan. He told a world affairs forum in Michigan on Friday: "There are still horrific attacks in Iraq, such as the bombings in Baghdad on Wednesday, but the direction of the fight is beginning to shift."
He said General David Petraeus, the US commander in Iraq, "reports that it will be later this year before we can judge the potential for success, but the first indications are beginning to emerge.
|Bush said on Friday there were indications|
of the security plan's success [AFP]
"And they show that so far the operation is meeting expectations".
Earlier, a senior Democratic politician who held talks with Bush on Wednesday said the US war in Iraq was lost and that a further build-up of US troops would not recover the situation.
"This war is lost, and this surge is not accomplishing anything, as is shown by the extreme violence in Iraq this week," Harry Reid, the senate Democratic majority leader, said on Thursday.
He later said the "White House spin machine was working overtime" to defend Bush's failed policies and that the president and his allies were attacking those with "courage to ask the tough questions, to tell the truth about Iraq."
In Baghdad, after Friday's meeting with Gates, al-Maliki repeated that his priorities remained national reconciliation, restoring security and legislative reform.
"The prime minister is optimistic that Iraqis of whatever political and ideological faction will be able to escape from the trenches of sectarianism for the sake of the country," a statement from his office said.
Gates said the ongoing Baghdad security plan, backed by extra US troops, aimed to give al-Maliki time and space for political progress, not to end the conflict itself.
While acknowledging that recent deadly bomb attacks had been a setback, he said: "The surge is a strategy for buying time for progress towards justice and reconciliation in Iraq."
In what appeared to be a boost for the security plan, however, Sheikh Abdul Mahdi al-Karbalae, representative of Grand Ayatollah Ali al-Sistani, the Shia cleric in the central shrine city of Karbala, urged Iraqis to support the security operation despite the bombings.
"We are concerned that such violence could trigger more reprisals and hence more bloodshed," he said in his Friday sermon.
"If the crackdown succeeds it will benefit Iraq by bringing progress, but its failure will harm everybody."
Potential for success
Before leaving Baghdad's secure Green Zone by US military helicopter on Friday, Gates met Jalal Talabani, the Iraqi president, and Tareq al-Hashimi and Adel Abdel Mahdi, his two vice-presidents.
They discussed the "importance of national reconciliation" to end the Shia-Sunni conflict, a statement from Talabani's office said.
"They also discussed the accountability and reconcilation law which aims to promote reconciliation and national unity among Iraqis."
The law is refinement of the controversial de-Baathification law. It aims to reintegrate former supporters of Saddam Hussein into public life in a bid to reduce the bitterness fuelling the Sunni anti-American campaign.