The truck bomb in Diwaniyah was detonated near the city's main fish and vegetable market, where local officials had reopened the streets to vehicles less than five months ago after keeping them closed for years over security concerns. The area was crowded with morning shoppers at the time of the explosion.

"What did we do wrong?" said Saad Abbas, a teacher who awoke later in a local hospital, where he was being treated for wounds to the head and chest. "I was shopping for my family, and I felt a huge explosion. I fell to the ground, and the next thing I know I am in the hospital."

Over all, the attacks on Tuesday left nearly 50 people dead and more than 100 wounded. The variety of methods used is indicative of what Iraq still faces on a daily basis, more than six months after the American military departed and more than nine years after it invaded: a huge truck bomb, improvised explosives and assassinations by gunfire.

In Karbala, a holy Shiite city in the south, two homemade bombs that were attached to vehicles detonated in a vegetable market, killing six people and wounding more than 25, according to a local police official. The explosions came three days before an important Shiite religious ceremony is scheduled to be held in the city, raising the specter of further violence against Shiite pilgrims, who are frequently targeted by insurgents.

In Taji, north of Baghdad, explosions killed two and wounded more than 15. Near Baquba, in Diyala Province, a soldier and a policeman were killed by gunmen, and the bodies of two people who had been shot in the head were found in a farmer's field, according to a police official.

These attacks continued an upsurge of violence in Iraq that began last month, exacerbating a sense of fatalism in the country. Ordinary Iraqis have seen little noticeable improvement in security for nearly three years, a stark fact that conflicts with the narrative offered by American and some Iraqi officials that the situation in the country is steadily improving.

Antony J. Blinken, the national security adviser to Vice President Joseph R. Biden Jr., wrote in Foreign Affairs recently that since President Obama took office, "violence in Iraq has declined and remains at historic lows — a trend that has continued since the last U.S. troops departed late last year."

In fact, though, more Iraqis — civilians and security force members alike — have died from attacks in the first six months of 2012 than in the comparable period of 2011, according to United Nations statistics.

According to these figures, security radically improved in 2007 when a "surge" of additional American troops was sent to Iraq, but the rate of violence has been roughly level since 2009. The United Nations, which compiles the figures from a variety of sources and publishes them online, cautions on its Web site that the data "does not represent the official views of the organization, but provides a snapshot of information available at this time."

The United Nations reckons that through the end of June, 2,101 Iraqis were killed in violent attacks in 2012, compared with 1,832 in the first half of 2011.

Lately, many of the victims have been Shiites killed at the hands of Al Qaeda in Iraq, the Sunni insurgent group that has claimed responsibility for several high-profile attacks. The violence has not had any noticeable political impact, nor does it appear to threaten the state or indicate a return to widespread sectarian violence of the kind that Iraq suffered in 2006 and 2007.

The national government has been stuck in political paralysis since December, when an arrest warrant was issued for Vice President Tariq al-Hashemi, a Sunni Arab, on charges that he commanded a death squad responsible for assassinations and bombings. Iraq's three main factions — the Shiite majority and the minority Sunni Arabs and Kurds — have been dueling one another for political power in a struggle infused with ancient grudges and resentments, precluding any sense of compromise or equanimity. Sunnis and Kurds have called for the ouster of the Shiite prime minister, Nuri Kamal al-Maliki, who has been asserting control over the apparatus of state. Many Iraqis worry that Mr. Maliki has gone too far in consolidating power. But others believe that only a strong man at the top can effectively lead the country, and Mr. Maliki's popularity has actually increased in many corners of Iraq.

Meanwhile, insurgents seem to be using the political situation as pretext to launch attacks, and there is a widespread feeling that at least some of the violence is carried about by groups with links to politicians.

"I want to tell you one thing," said Moktada al-Sadr, the Shiite cleric who once led a Shiite insurgent group that fought the Americans and now commands a major bloc in Parliament, in a recent meeting with Iraqi and foreign journalists. "What is happening is not Sunni and Shia. It's about the political process. Al Qaeda is not for the Sunnis."

In Diwaniyah, which had been relatively placid before Tuesday, officials imposed a curfew and put out a call for blood donors.

At the badly damaged market, one shop owner considered Iraq's cruel fate.

"Why is this happening?" said Saleem Ahmed, who happened to be sheltered behind a shop building when the truck bomb went off and thus escaped injury. "The terrorists are not targeting the government; it's the Iraqi soul they are targeting. What I saw today of bodies and wounded people, it's something I won't forget. Vegetables were mixed with blood and pieces of flesh, and I helped the wounded get to the hospital."

Duraid Adnan contributed reporting from Baghdad, and employees of The New York Times from Karbala, Diwaniyah and Baquba, Iraq.

This article has been revised to reflect the following correction:

Correction: July 3, 2012

Because of an editing error, an earlier version of this article misstated in one passage the portion of the year in which more Iraqis were killed in 2012 than in 2011. It was the first six months of each year, not the first five.