Car bombs killed 23 people in Baghdad and three other Iraqi cities on Wednesday but US Defense Secretary Robert Gates said a secure, stable country was within reach.
A car bomb near a Shi'ite mosque in central Baghdad killed 15 people and wounded 35 as they gathered for evening prayers, making it the capital's deadliest bombing since September.
Gunfire could be heard and black smoke rose over the area after the blast in the mainly Shi'ite Karrada district, just across the Tigris River from where Gates met Iraqi officials in the heavily fortified "Green Zone" compound.
An al Qaeda-affiliated group warned this week of a renewed campaign of car bomb attacks.
Despite the day's bloodshed, overall attacks across Iraq have fallen to their lowest level in nearly two years, focusing attention on whether the Shi'ite-led government can reconcile with disaffected minority Sunni Arabs.
"More than ever, I believe that the goal of a secure, stable and democratic Iraq is within reach," Gates told a news conference less than an hour after the Baghdad blast.
"We need to be patient. We also need to be absolutely resolved in our desire to see the nascent signs of hope across Iraq expand and flourish so that all Iraqis can enjoy peace and prosperity."
On his unannounced visit Gates urged the government to integrate mainly Sunni Arab neighbourhood patrol units into its army and police. Washington says the 60,000-strong neighbourhood patrol forces have helped reduce violence.
"Iraqis who have chosen to fight Al-Qaeda need to be integrated into Iraq's security forces or provided other job opportunities," Gates said.
Earlier on Wednesday the government took a step in that direction by announcing it would put 45,000 of the patrol members on its payroll by the middle of 2008.
That means tens of thousands of armed Sunni Arabs, many believed to have fought against the government before this year, will soon be working for it.
The government had been regarded as being lukewarm to the neighbourhood patrols, fearful they could turn into an unaccountable militia made up of its recent foes.
Instability in the north
Gates touched down first in Mosul, north of Baghdad, in a region US commanders now consider one of the most violent parts of Iraq after al Qaeda militants relocated to the north and northeast following crackdowns in the capital and the west.
Hours before Gates arrived a car bomb near a police station killed a civilian in Mosul, Iraq's third largest city. Car bombs in Baquba and Kirkuk, two other cities north of Baghdad, killed at least seven others.
A group of US combat brigade commanders, speaking to reporters at the Camp Victory military base in Baghdad, sought to play down the impact of the car bombing in the capital.
"The extremists are on the ropes. They are clearly on the ropes," said Colonel Jon Lehr, who is based in Diyala province.
"They are trying to consolidate their gains and make a statement to create a fracture between the population, the Iraqi security forces and the coalition forces."
The US military announced the deaths of three of its soldiers in Salahuddin province, another of the northern areas that has suffered increased fighting. But Gates said commanders in the north had told him that their enemy was now appearing in smaller, less sophisticated units than a few months ago.
Colonel Raymond Thomas, an assistant commander of the US division responsible for the north, said more troops were being sought for Diyala province, of which Baquba is the capital.
President George W Bush sent an extra 30,000 US soldiers to Iraq earlier this year to try to pull the country back from the brink of all-out sectarian civil war and to give Iraq's leaders "breathing space" to reach a political accommodation.
But Prime Minister Nuri al-Maliki's government has made little headway in passing laws aimed at reassuring Sunni Arabs they will share in Iraq's oil wealth and political power.