The American military suffered the deadliest attack against its forces in Iraq in more than two years Monday when rockets slammed into a joint U.S.-Iraqi base in Baghdad, killing five U.S. troops and reviving concerns about security and the stability of the country’s unwieldy coalition government.

The attack occurred around dawn at Camp Loyalty, known to Iraqis as Baladiyat base, when about six rockets struck near the U.S. residential quarters, according to Iraqi security officials. The rocket strikes were part of a day of violence across Iraq that left at least 17 Iraqis dead. Insurgents detonated car bombs, booby-trapped a house with explosives and attacked security checkpoints in the capital.

Iraq is a less violent place than it has been for much of the time since the U.S.-led invasion in 2003, but recent attacks have caused unease. Prime Minister Nouri al-Maliki is under growing pressure to assert more leadership as Iraqis face newly emboldened terrorist groups, continuing shortages of clean water and electricity, and a new national government that often appears paralyzed by mistrust.

“The complexity of the political situation has weakened the government in general and weakened our security forces to prevent actions by terrorists,” said Falah al-Naqib, who was interior minister in 2004 and 2005 under former prime minister Ayad Allawi. “If the situation remains as it is right now, it’s going to get much more complicated and we might see a lot more problems.”

Maliki did not speak publicly about Monday’s violence, but he appeared to acknowledge the fragile state of his government in a televised address Saturday.

Security contractors inspect their armored vehicles after a roadside bomb attack in Baghdad, Iraq, Monday, June 6, 2011. (Khalid Mohammed/AP)

“Neither I nor the security officials are afraid of the security breaches,” Maliki said. “But what scares me is when the breaches have . . . political motives.”

The recent violence comes as Maliki faces a critical milestone in efforts to head off mass demonstrations similar to those in other Arab capitals this spring.

In February, after several days of demonstrations that killed nearly two dozen people across Iraq, Maliki asked protesters to give him 100 days to address their concerns about corruption, unemployment and shoddy government services.

With his grace period due to expire Tuesday, U.S. and Iraqi officials are increasingly concerned about the potential for more unrest as they try to decide whether U.S. forces should stay in the country past the end of the year.

About 46,000 U.S. troops remain in Iraq, but under a three-year-old security agreement, the last American soldier is scheduled to leave the country by Dec. 31.

Jay Carney, President Obama’s press secretary, said Monday that the administration intends to comply with the agreement but added that it would “entertain” requests from Iraqi officials to change the agreement if they thought that U.S. troops would be needed to ensure stability.

Obama is under pressure to continue what has been a steady drawdown in Iraq, but administration officials stress that they do not want to see the security or political situation in Iraq deteriorate after the last U.S. troops leave.

U.S. military officials had hoped Iraq’s political leaders could form a consensus by midsummer on whether they will ask for an extension of the security agreement. But Haidar Abadi, a Parliament member closely aligned with Maliki, said in an interview Monday that U.S. officials should not expect a decision before fall.

“Iraq’s political system works under pressure,” Abadi said. “I think most Iraqi politicians feel there is enough time . . . and our back is not tied to the wall and we have a few months to decide.”

Even so, Abadi added, “There is no political atmosphere to allow for any extension.”

Maliki’s coalition includes the strenuously anti-American cleric Moqtada al-Sadr, who two weeks ago paraded his Mahdi Army through Baghdad’s Sadr City demanding a complete withdrawal of U.S. forces by the end of the year.

U.S. officials fear that the cleric’s followers could take to the streets, posing potentially severe challenges for Maliki’s government, if American troops stayed past this year.

Although Sunni tribal and political leaders have said they would like some U.S. troops to remain in the country — in part to keep Sadr’s influence in check — the predominantly Sunni Iraqiya block in Parliament has shown little willingness to speak up in support of such a move.

With growing skepticism about a continued U.S. presence, Abadi and other Iraqi political leaders say they hope the discussion in Baghdad will turn toward how Iraq will defend itself in absence of U.S. troops. But more than six months after Iraq’s unity government was formed, Maliki and Parliament remain deadlocked over appointments to head the Defense, Interior and Intelligence ministries.

“None of the political blocs have any idea about the ability of the Iraqi military and security forces, if they are capable enough,” said Haider al-Mulla, a spokesman for the Iraqiya bloc. “Maliki is controlling everything.”

In recent days, much of the violence, including a suicide bombing in Tikrit that killed at least 11 people, has appeared aimed at Sunni political and tribal leaders who have spoken out against the Sunni insurgent group al-Qaeda in Iraq or cooperated with Iraq’s national government. The group has claimed responsibility for some of the violence.

Wilson reported from Washington. Special correspondents Aziz Alwan and Asaad Majeed in Baghdad contributed to this report.