Updated

The United States opened its new embassy in Iraq under tight security Monday, the most visible sign of what U.S. officials call a new chapter in relations between America and a more sovereign Iraq.

The inauguration of the $700 million fortress-like compound in the heart of the Green Zone came just days after a security agreement between Iraq and the United States took effect, replacing a U.N. mandate that gave legal authority to the U.S. and other foreign troops to operate in Iraq.

"Iraq is in a new era and so is the Iraqi-U.S. relationship," Ambassador Ryan Crocker said during an inauguration ceremony at the embassy.

But as Crocker lauded progress made in Iraq, Baghdad was rocked by a second day of violence that saw four car bombs explode in various parts of the city, killing four people and wounding 19 others. It came a day after a suicide bomber killed at least 38 people at a Shiite shrine just four miles north of the site of the new embassy.

Before the ceremony, Crocker told The Associated Press that Iraq has made tremendous progress over the past three months but the United States must remain engaged over the long term if it wants those gains to solidify.

"I think we have seen a tremendous amount of progress, even since September. But the development of this new Iraq is going to be a very long time in the making, and we need to be engaged here," Crocker said.

Crocker's remarks were an indirect appeal for the U.S. to stay engaged diplomatically and politically in Iraq, regardless of the eventual withdrawal of the approximately 146,000 troops stationed here. The veteran diplomat has served before in the Middle East, where a lack of U.S. resolve in places like Lebanon 20 years ago opened that country to meddling from Iran and Syria.

Crocker said Baghdad was looking to the West for the first time since the 1958 revolution which toppled Iraq's monarchy and set the stage for the ascendance of the Baath party that ruled Iraq with an iron fist until the 2003 invasion.

"Iraq has defined itself in general hostility to the West and the United States," Crocker said. "You now have a fundamentally different state and society taking shape that values those relations, that values those contacts, that wants its children educated in American and other Western universities. And we need to be there as a partner to ensure that those relationships are solidly built and well maintained."

"We will be engaged in different ways as security continues to improve and as Iraqi security forces are more and more in the lead. But that engagement over the long term is key," he added.

Under the new security agreement, U.S. troops will no longer conduct unilateral operations and will act only in concert with Iraqi forces. They must also leave major Iraqi cities by June and the entire country by the end of 2011. Another accord mapped out the bilateral relations.

Crocker said that since the 2003 invasion, "perhaps no single week has been more important than this past week. On Dec. 31 we left the Republican Palace."

U.S. diplomats and military officials moved into the embassy on Dec. 31 after vacating Saddam Hussein's Republican Palace, which they occupied when they captured Baghdad in April 2003. The palace will now seat the Iraqi government and the office of Prime Minister Nouri al-Maliki, who did not attend the Monday's ceremony because he was traveling in Iran.

For nearly six years, the grandiose and gaudy palace, with its gold-plated bathroom fixtures, wall paintings of Scud missiles and enormous chandeliers, served as both headquarters for occupying forces and the hub for the Green Zone — the walled-off swath of central Baghdad that was formally turned over to the Iraqi government on New Year's Day.

The new embassy will have working space for 1,000 people and also provide housing for hundreds of staff that have been living in makeshift quarters.

Iraqi President Jalal Talabani, a longtime Washington ally, praised President George W. Bush's decision to invade Iraq and topple Saddam, who was executed two years ago.

"The building of this site would not be possible without the courageous decision by President Bush to liberate Iraq," said Talabani, a Kurd. "This building is not only a compound for the embassy but a symbol of the deep friendship between the two peoples of Iraq and America."

Though violence has plummeted around Iraq in the past year, with attacks dropping from an average 180 a day to just 10, horrific bombings still plague the capital. Many recent attacks have targeted pilgrims during ceremonies commemorating the death of a much revered Shiite saint.

On Monday, a roadside bomb killed two police officers and wounded five in eastern Baghdad. Another killed a man driving in central Baghdad while two roadside bombs wounded more than 10 people — including seven Shiites preparing to head to the holy city of Karbala, south of Baghdad, where the ceremonies will reach their pinnacle on Wednesday.

Iraqi officials said Sunday's suicide bomber, who killed at least 38 people outside the shrine of Imam Mousa al-Kazim in Baghdad, was a man disguised as a woman. Initial reports said the attacker was a woman concealing a bomb under her black cloak. At least 17 of the dead were Iranian pilgrims.

In response to that attack, Iraqi authorities banned female pilgrims from entering the district for ceremonies on Tuesday and Wednesday.

Hundreds of thousands of Shiite pilgrims are expected to visit Karbala and other shrines around Iraq during Ashura, which on Wednesday will mark the anniversary of the 7th-century death of Prophet Muhammad's grandson Hussein.

He was killed in a battle that was part of a dispute over the leadership of a young Muslim nation following Muhammad's death in 632.

Iraqi security forces have deployed thousands of troops in Baghdad, Karbala and on roads linking the two cities to safeguard the ceremonies. Attacks by Al Qaeda in Iraq, Sunni insurgents and even a Shiite cult have killed hundreds of people in recent years.