Al Qaeda and its affiliates have been given an opening to revive operations in former strongholds by the U.S. pullout from Iraq's northern and western provinces, a senior Iraqi official said.

Nearly nine years after the U.S.-led invasion, the American military has handed the Iraqi government most of its military bases around the country, and the remaining 23,000 American troops will leave by the end of the year.

Iraq says its forces are now able to contain insurgents. But

with U.S. troops leaving, weaknesses in Iraqi forces are already coming to light in hotspots like Diyala province and the Mosul area, senior Interior Ministry official Adnan al-Asadi told Reuters in an interview.

Asadi said the number of U.S. military personnel deployed in a strategic triangle in northern and western Iraq was not large but their aircraft cover and capabilities had been useful to control an area where insurgents have traditionally operated.

When the U.S. withdrew from this triangle which is Diyala, Salahuddin, Anbar and Mosul ... a gap was left behind, he said.

Al Qaeda has redeployed in the area... Al Qaeda is present, it appears and disappears and carries out operations, attacks and retreats. It's a guerrilla war, but they are no longer able to hold ground.

Violence in Iraq has eased off dramatically since the peak of sectarian fighting in 2006-2007. But bombings and killings persist on a daily basis and a stubborn Sunni Muslim insurgency linked to al Qaeda, as well as Shi'ite Muslim militias, remain capable of lethal attacks.

Asadi said intelligence indicated al Qaeda organisations are deployed in Diyala, Anbar and the southern desert of Nineveh, with some of their leaders in Salahuddin, but that they hid by staying in small groups of three or four and acting as goat- or camel-herders.

Asadi said the Iraqi army and federal police conducted a large raid around three weeks ago to bomb a remote area where al Qaeda fighters were operating, and most insurgents were forced out to neighbouring areas while some were arrested in Mosul.

Officials say al Qaeda affiliates carry out attacks on local government buildings and national security forces to try to destabilise the central government and demonstrate that it cannot provide security as the American troops leave.

BAATHIST CHALLENGE

Since the 2003 fall of Sunni dictator Saddam Hussein, Iraq's Shi'ite majority have been on the ascent, while some in the Sunni minority complain they feel they have been sidelined by Prime Minister Nuri al-Maliki's government.

Government officials have long expressed concern that former Baathists would try to disrupt the government when U.S. troops depart. The party was banned after the U.S.-led invasion that toppled Saddam, who was later tried and executed.

Iraq arrested hundreds of former military officers and members of the Baath Party last month, a move some officials said had foiled a plot, while others said it was a precautionary measure before the U.S. withdrawal.

Asadi said the al Qaeda-tied group Islamic State of Iraq and banned Baathists posed the biggest security challenge with the U.S. withdrawal, while other outlawed groups are expected to fade away.

Asadi said intelligence showed most suicide attacks that have been thwarted in recent weeks were planned, funded and logistically supported by the Iraqi Baath Party now based in Syria, but carried out using al Qaeda fighters.

After the U.S. invasion, neighbouring Syria became a base for insurgents who slipped across the porous frontier to attack American troops in Iraq.

The Baath Party is using al Qaeda, using the Islamic State of Iraq, and the logistics, finance, and intelligence is the Baath Party's part of the mission, he said.

Security and police officials had said last month Maliki had issued arrest warrants for around 350 former Baath Party members.

But Asadi said that the list includes more than 800 Baathists and 620 of them were arrested, most of them Shi'ites who were planning demonstrations, bombings, sabotage and assassinations in conjunction with the U.S. pullout.

It was not a coup in the sense of a military coup with the use of the army, but it was an attempt to destabilise the security situation, to abort the political process, Asadi said.

(Editing by Patrick Markey and Mark Heinrich)