Baghdad, Iraq - Summer in Iraq has become a season of terror.

Five years after pulling itself out of civil war, the country is again mired in a relentless series of bombings, political assassinations and sectarian attacks that have stalled progress many Iraqis hoped they would achieve.

This year the holy month of Ramadan - when many Muslims fast in the day and gather in mosques, cafés and markets in the evening - has been marked by almost daily attacks on a widening range of targets.

Almost 600 people have been killed so far in July, most of them civilians. This month's toll follows a grim landmark in May when the UN reported at least 963 civilians had been killed and more than 2,000 injured in the biggest monthly casualty toll since 2008.

"The war continues," says Brigadier General Saad Mann, the Interior Ministry spokesman, who blames most of the attacks on al-Qaeda. "Their first aim is to kill as many people as possible, the second is to send a sectarian message, and the third is the continuation of what is happening in the region - what is happening in Syria is definitely affecting Iraq."

The Iraqi government has closed its borders with Syria in fear that groups affiliated with al-Qaeda, intent on creating a cross-border Islamic state, will shift the fighting into Iraq. In an increasingly sectarian conflict in Syria - pitting the Iranian-backed government against mostly Sunni Muslim Syrian fighters - neighbouring Iraq is seen as fertile ground for a resurgent civil war.

Although the carnage and destruction fall far short of previous years, the coordination and resources required to consistently execute such complex attacks point to groups affiliated with al-Qaeda regenerating.

"I can't think of any other group that would be able to carry these out," said one Western official familiar with security threats here, who asked to remain anonymous.

Many of the attacks have involved suicide bombers - the hallmark of al-Qaeda. Iraqi security officials say they are seeing more evidence of foreign suicide bombers and fighters from North Africa and other Arab countries believed to be coming across the Syrian border.

The Islamic State of Iraq, the al-Qaeda umbrella group, has not claimed responsibility for the attacks during Ramadan, but since its bombing of one of the holiest Shia shrines in Samarra in 2006, it has worked to restart civil war.

Prison breaks

The group has also pledged to break al-Qaeda prisoners out of Iraqi jails. It seems to have made good on its threat with an attack late Sunday on the notorious Abu Ghraib prison near Baghdad and the Taji prison north of the city. The jails were stormed by suicide bombers and gunmen in fighting that killed more than 50 soldiers, guards and inmates, as well as attackers. It took hours for Iraqi army troops and helicopters to quell the rioting at Abu Ghraib. The head of parliament's security says officials have told them 350 prisoners managed to escape - among them four al-Qaeda emirs.

In an indication of the disarray of Iraq's security forces, the top army commander of the Abu Ghraib area publicly resigned shortly before the attack on the prison, saying in a posting on his Facebook page Sunday that he was quitting in protest against "random and unprofessional decisions" by the senior chain of command.

Security sources confirmed that General Abdul Nasser al-Ghanam, commander of the 17th Army Division, was no longer in his position, but said it was unclear whether he had resigned or had been fired.

Although security forces, particularly outside Baghdad, have borne a large part of the brunt of attacks, recent bombings have increasingly taken advantage of Iraqis gathering at night in crowded markets and cafes after breaking the day's fast during Ramadan. Over the weekend, 11 car bombs detonated in Baghdad on a single evening, killing market vendors, shoppers and families trying to escape the heat and electricity cuts at home.

"Targeting ministries and directorates in Baghdad has become more difficult," says General Mann. "That is why they have started to target mosques, Husseiniyahs [Shia places of worship], and local markets."

He said unlike al-Qaeda attacks several years ago, which used up to a tonne of sophisticated explosives in a single bombing, the most recent bombs are generally made from easily obtainable materials such as fertilizer enhanced with steel ball bearings to inflict a maximum number of casualties.

Although few Iraqis mourn the withdrawal of US forces from Iraq after the two governments failed to agree on a new legal arrangement, their departure has left the country with gaps in crucial intelligence gathering capability and analysis that it is still trying to fill.

On the ground, security forces at checkpoints are still equipped with explosive detection devices that have proved to be ineffective; the British businessman behind them has been jailed for fraud. Iraqi officials insist the machines work well enough to keep them in operation.

Sectarian violence

The attacks are against a backdrop of an ongoing political crisis expected to worsen as the country heads into national elections next year. In addition to ongoing Sunni protests - some demanding their own region - Shia parties have been splintering.

One of Prime Minister Nouri al-Maliki's newest allies, the Shia group Asab Ahl-al Haq, officially renounced violence against Iraqis to try to enter the political mainstream in a reconciliation process originally overseen by the US and British militaries several years ago. The group's leadership has remained unapologetic for the killing of US soldiers.

Many blame political parties for assassinations and other attacks as a way to make up power lost in the ballot box, and to divert attention from the government's lack of services such as clean water and electricity.

"The problem is what's happened in the elections," said Ahmed Rushdi, an Iraqi political analyst referring to provincial polls earlier this year. "Some blocs lost support in the elections and it means they need to raise a new flag - nothing is easier than sectarian violence."

Some blocs lost support in the elections and it means they need to raise a new flag - nothing is easier than sectarian violence. -Ahmed Rushdi, Iraqi political analyst

Thirty-five kilometres north of Baghdad near Baquba in Diyala province, a series of attacks that started with the bombing of a funeral has raised fears that sectarian discord could again be starting.

The country was plunged into civil war with the 2006 al-Qaeda bombing of one of the holiest Shia shrines in the largely Sunni city of Samara. The attack sparked retribution by Shia militias. Without a strong police or army, the country descended into civil war. Al-Qaeda has been trying to restart it ever since.

In July, a suicide bomber on a motorcycle blew himself up at a mourning ceremony for a member of a Shia tribe in the town of Muqdadiya. In retaliation dozens of Sunni families were driven out of their homes and a Sunni mosque was attacked. The violence has since eased but has prompted fears that tribal tension could carry sectarian conflict from Diyala to other provinces.

"Diyala is not just a single case - Diyala is now the number one problem for the entire society today, and we are all afraid that what happened in Diyalah will happen in other places," says Safia Suhal, an indendent member of parliament and one of the most prominent members of the Tamim tribe.

"What we're seeing today in Diyala is militias and certain political groups benefitting from taking sides, either with the Shia or the Sunnis, rather than working seriously on national reconciliation," she says.

"Our security forces should act in bringing the killers in front of the courts and justice should take place and nobody should interfere. But that is not happening."