The new U.S. commander in Iraq warned on Saturday that the country was "doomed to continued violence and civil strife" if American and Iraqi forces did not work together.

Gen. David Petraeus took command of the 135,000-strong U.S. force, declaring "we will have to share the burdens and move forward together. If we can do that and if we can help the people of Iraq, the prospects of success are good.

"Failing that, Iraq will be doomed to continued violence and civil strife."

Standing under a crystal chandelier that spanned 30 feet of the ceiling in one of Saddam Hussein's former palaces, Petraeus said the task before him was "exceedingly challenging."

"The stakes are very high. The way ahead will be hard, and there undoubtedly will be many tough days. But as I recently told members of the U.S. Senate, hard is not hopeless."

Petraeus, who has served two previous tours in Iraq, takes over from Gen. George Casey who becomes Army chief of staff.

In a letter to U.S. troops in Iraq, Petraeus said "in the end, Iraqis will decide the outcome of this struggle. Our task is to help them gain the time they need to save their country."

The change in command was part of President Bush's overhaul of Iraq policy that includes deployment, by the end of May, of 21,500 additional American forces in Iraq, most of them in Baghdad.

"Our job in the months ahead ... will be to improve security so that the Iraqi government can resolve the tough issues it faces, and so that the economy and basic services can be improved," Petraeus said. "These tasks are achievable. This mission is doable."

The Princeton-educated general takes command at a time when the Bush administration has focused on Iran as a key factor in the turmoil in Iraq.

National security officials in Washington and Iraq have worked for weeks on a presentation intended to provide evidence of what they say are Iran's meddlesome and deadly activities. U.S. officials in Baghdad scheduled a briefing for reporters Sunday.

On Friday, Defense Secretary Robert Gates told reporters that serial numbers and other markings linked the Iranians to explosives used by insurgents in Iraq. His comments were among the Bush administration's first public assertions about evidence the military has collected.

The U.S. military on Saturday announced three more American soldiers had died in an explosion in volatile Diyala province northeast of Baghdad. The blast occurred as Task Force Lightning soldiers searched for a weapons cache near Baqouba. U.S. and Iraqi forces have battled Sunni insurgents and Shiite militias in Diyala for months.

The deaths raised to 36 the number of Americans killed in Iraq so far this month. At least 3,120 members have died since the Iraq war started in March 2003, according to an Associated Press count.

Dozens of Shiites and a handful of Sunnis gathered Saturday for the reopening of a Sunni mosque in Baghdad's Shiite militia stronghold of Sadr City. Local officials said they hoped to encourage members of the displaced Sunni minority to return to the district as part of reconciliation efforts.

A Sunni cleric led a joint prayer under the mosque's blue mosaic dome and beige minaret. Interior Ministry commandos stood guard outside.

Sadr City is the headquarters of the Mahdi Army, the militia of radical Shiite cleric Muqtada al-Sadr. The fighters are blamed for much of the sectarian killing that has targeted minority Sunnis in a year of revenge killings after Al Qaeda in Iraq bombers destroyed an important Shiite shrine north of Baghdad.

"The Sadr movement is working to consolidate national unity and today's handover is proof of our intentions," Sadrist lawmaker Nassar al-Rubaie said. "We will work to bring back the deported Sunnis families to the city and to return other Sunni mosques."

Militia members are keeping a low profile and trying to improve their image as U.S. and Iraqi forces launch a security sweep that the Shiite-led government has promised would not spare Shiite militiamen or Sunni insurgents.

At the ceremony marking the change of command, Petraeus sat alongside Casey and Army Gen. John Abizaid, the outgoing Central Command chief. A U.S. Army band of the 1st Cavalry Division from Fort Hood, Texas, played the U.S. and Iraqi national anthems before the presentation of the flags.

Also in attendance were U.S. Ambassador to Iraq Zalmay Khalilzad, Iraqi National Security Adviser Mowaffak al-Rubaie and Iraqi Lt. Gen. Aboud Gambar, commander of Iraqi troops in the Baghdad security operation.

Prime Minister Nouri al-Maliki was absent.

Iraqi President Jalal Talabani and his two deputies met Petraeus on Friday and discussed the security plan and "appropriate ways to reach security and stability and annihilate terrorism," a government statement said.

Before the change of command, outgoing Iraq commander Casey said he was confident Iraqis would be ready to take control of their own security by the end of this year, but acknowledged progress was slower in Baghdad than the rest of the country.

"It's no secret that sectarian violence ... has changed the dynamics of what Iraqis must face here on the ground. But when Iraqis want something to happen, it happens," he told reporters.

Casey said failure in Iraq would be tied to the people's inability to put the past behind them.

"We liberated them from 35 years of tyranny but we can't liberate them from the fears and the prejudices that grew in those 35 years," he said. "I think they'll get past it, but if they don't, it'll be difficult."

Casey said he felt "a little numb" about leaving Iraq after 2 1/2 years.

"But I go away with great feeling of pride because we've laid the foundation for Iraq's ultimate success.

"Everything's not as I would have expected it to be or wanted it to be on my way out, but that's kind of the way things are," the departing general said.

Casey said he was still too close to the situation to evaluate his tenure but said he had a sense of where criticism could arise.

"The main point people will debate is whether I relied too much on Iraqi forces to carry the security load and too little on coalition forces," he said. "But I'm certainly not ready to say that's a mistake. I'll let history judge that."