Updated

Violence in Iraq, from bombings against cafes to assaults on prisons, killed about 1,000 people in July, more than any month since 2008, when the country was emerging from a bloody sectarian conflict.

"We haven't seen such numbers in more than five years, when the blind rage of sectarian strife that inflicted such deep wounds upon this country was finally abating," UN envoy Gyorgy Busztin said in a statement.

Iraq was racked by a bloody Sunni-Shiite sectarian conflict that peaked in 2006-2007, when thousands of people were killed because of their religious affiliation or forced to abandon their homes under threat of death.

"I reiterate my urgent call on Iraq's political leaders to take immediate and decisive action to stop the senseless bloodshed, and to prevent these dark days from returning," Busztin said.

According to Iraqi government figures, 989 people were killed in July, making it the deadliest month since April 2008.

The vast majority of the dead were civilians, though Iraqi security forces were also targeted in attacks.

The United Nations put the toll for July at 1,057 people killed, while AFP counted 875 deaths.

Tolls vary depending on sources and methodology, and officials in Iraq often give differing numbers in the chaotic aftermath of attacks.

But all show that the security situation in Iraq is worsening.

Illustrating the severity of the violence, UN figures show more than twice as many civilians were killed in Iraq during the first six months of 2013 than over the same period in Afghanistan.

In one of the month's deadliest attacks, a suicide bomber detonated explosives in a cafe in the northern city of Kirkuk, killing 41 people.

Militants regularly targeted cafes, where Iraqis often meet after breaking their daily fast during the Muslim holy month of Ramadan, and also attacked mosques, where extended evening prayers are held during the month.

Al-Qaeda front group the Islamic State of Iraq and the Levant claimed attacks on Abu Ghraib and Taji prisons in July that killed over 50 people and saw more than 500 inmates, including senior Al-Qaeda leaders, escape.

"The prison attacks demonstrate that the security forces are poorly resourced and unable to protect what should have been well-defended facilities," said John Drake, an Iraq specialist with risk management firm AKE Group.

And in an incident reminiscent of the worst years of sectarian conflict in Iraq, militants set up a checkpoint on a highway north of Baghdad, examined the ID cards of truck drivers and then executed 14 who were Shiite Muslims.

"We don't go out of the house anymore. You go to the cafe, you get killed, you go to your car, you get killed, you go to the supermarket, you get killed," 47-year-old Imad said in the Iraqi capital.

Officials should "fix politics so security gets better, but (a) political solution in this country needs a miracle," he said.

Widespread discontent among members of Iraq's Sunni Arab minority is a major factor behind the heightened violence this year, experts say.

"There is widespread frustration with the predominantly Shiite government and security forces amongst the Sunni community, because they feel marginalised and persecuted," said Drake.

"The terrorists, most of whom are radicalised Sunnis, are conducting attacks against the government and security forces to try and capitalise on this frustration," he said.

"Animosity towards the government is also likely to persist as long as the security forces use excessive force to arrest suspects and deal with protests in predominantly Sunni parts of the country," Drake said.

Protests broke out in Sunni-majority areas of Iraq at the end of 2012, and are still ongoing.

International Crisis Group Iraq analyst Maria Fantappie said an April 23 security forces operation at a protest camp near the town of Hawijah, which sparked clashes that killed dozens, was a key factor in the unrest.

"I think that it's very important to see Hawijah as the turning point for the violence," Fantappie said.

The incident triggered the reactivation of some insurgent groups in the north and also corresponded to increasing Al-Qaeda activity and sectarian attacks -- three main factors driving the heightened violence, she said.

It is ultimately up to the government to act to curb the violence, she said, with negotiating local ceasefires with Sunni officials being one option.

The government "was part of the problem, and it is part of the solution," Fantappie said. "It's the only actor that can bring things (back) on track."