Updated

MOSUL, Iraq (AP) — When the U.S. ends its combat mission in Iraq five weeks from now, the nation's safety will be in the hands of its homegrown, American-trained security forces. The army is almost up to the job, the police are hit-and-miss, and the Kurdish militia is nowhere close to ready.

Iraq's military chief says that without a U.S. presence, the Iraqi forces won't be able to fully fend for themselves before 2020. Anthony Cordesman, a former director of intelligence assessment in the Pentagon, agrees it will take years.

That view has also come across in conversations on various sides of the sectarian divide in recent months as The Associated Press spent time with the military, police and Kurdish militia on the job to get a sense of their strengths and weaknesses as they prepare for the Aug. 31 deadline for the U.S. combat mission to end.

To be sure, Iraq's security forces have made great strides since the 2003 fall of Saddam Hussein, after which his army was disbanded and the once-feared police were jeered as toothless. U.S. commanders say violence is down by more than half since a year ago, when American troops pulled out of Iraqi cities, and has dropped 90 percent since October 2007 — the peak of the U.S. military surge in Iraq.

But bombings still happen almost daily across Iraq, often targeting the security forces. Drive-by shootings and kidnappings are common. And despite at least $22 billion the U.S. has spent on training and equipping the forces since 2004, many of the problems that have long plagued the army and police remain unresolved.

The U.S. military, preparing to pull out completely by the end of 2011, has been promoting an image of a capable Iraqi security force. Barely a day passes without an announcement of the arrest or killing by homegrown security forces of insurgents, mostly suspects from al-Qaida in Iraq, as well as ordinary criminals.

"Clearly there's still some violence, and we still need to make more progress in Iraq," U.S. Gen. Ray Odierno, commander of U.S. forces in Iraq, told reporters at the Pentagon on Wednesday. "But Iraqi security forces have taken responsibility for security throughout Iraq, and they continue to grow and improve every day."

Yet there remain deep gaps in training and equipment for the roughly 675,000 members of the security forces. Even more important, sectarian and ethnic divisions among various security branches have been only superficially addressed and threaten to re-ignite tensions.

"We need the Americans until we get strong," Yasser Majid, a 26-year-old Shiite army lieutenant, said last month on patrol in the Iraqi town of Jalula. "Otherwise it could go back to just like it was in 2006 with sectarian violence."

The readiness gap means that the army is still performing some of the roles that ought to fall to the police, such as manning city checkpoints where cars are searched for bombs.

Dozens of cars wait to be checked for bombs on Palestine Street, northern Baghdad. It was at this checkpoint, according to Sgt. Maj. Ali al-Hiani, that Iraqi army soldiers in March scored a coup: Recognizing his face from a wanted poster, they nabbed Munaf Abdul-Rahim al-Rawi, a militant with al-Qaida in Iraq.

That led to the killing of two of the group's leaders in a joint Iraqi-U.S. raid. At least 36 of al-Qaida's 44 senior operatives in Iraq have been captured or killed this year, mostly in joint U.S.-Iraqi operations.

After seven years of working alongside the American military, the Iraqi army of about 248,000 soldiers is widely viewed as the best trained and best equipped of the security forces.

But the troops should be guarding the borders, not manning checkpoints, said Col. Maan Muhanad. "The police are supposed to do it, but the city still needs the army."

Soldiers cruise the streets in U.S.-made Humvees and carry American rifles. But they and U.S. officials agree their hand-held explosive detectors are inferior and have often failed to flag cars used to bomb government buildings in Baghdad over the last year.

The army's intelligence-gathering is so poor that it still largely depends on American-supplied information, one of the few functions the U.S. military still commands since pulling out of Iraq's cities more than a year ago.

On each of three counterterror raids led by Iraqi police and army in Jalula, Mosul and al-Bailona in eastern Ninevah province over the last month, security forces accompanied by an AP reporter came up empty after expecting to capture insurgents or find weapons cashes. A U.S. military spokesman said that was not unexpected because recent al-Qaida arrests had taken many militants off the streets already, although he did not know how often it happened.

The army, like the police, is mostly Shiite, but has a Kurdish chief of staff, and since 2006 has allowed nearly 20,000 fired Sunni soldiers and officers to rejoin its ranks.

The concerns about security readiness are exacerbated by the political disarray resulting from the inconclusive March parliamentary elections. Although a Sunni-backed party narrowly topped the poll, Sunnis stand to be sidelined anew after Prime Minister Nouri al-Maliki allied with other Shiites in a grab for parliamentary power.

The result: Iraq is likely to be without a new government when the American combat role ends.

To the north, in the city of Mosul, a different security headache unfolds.

Mosul, one of the hottest fronts in the fight against the Sunni-dominated insurgency, is a prime example of the struggles of Iraq's local and federal police. They are deeply divided over sectarian and cultural issues, turf and the question of who is better at stopping the militants.

Lt. Col. Taha Daham al-Mashhadani is a Sunni Arab in a city that is culturally split mostly among Sunnis, Kurds and Christians. Born and raised in Mosul, he oversees the 17th Tammuz neighborhood for the city police force, which is hired by local authorities and trained by Iraqis.

He seldom lets his family leave their house, fearing insurgent attacks. On a recent drive through 17th Tammuz, he refused to stop at checkpoints for fear of suicide bombers like those who killed three of his officers the week before.

Mosul people have had bad experiences with the Iraqi soldiers and police from outside the region, so Taha has tried to be the friendly neighborhood cop. "I met with the people and sent them a note: 'To our families, to our friends, to our residents of Mosul...' They had never heard of something like that," he said.

That warmth, however, arouses the suspicions of the federal police tasked with counterterrorism in the city. Local police are too friendly with the people and can't be trusted, says Gen. Mustafa Mahmood Mansour, operations officer for the 3rd Federal Police Division based in Mosul.

"You have to have a cold heart to work with the federal police," said Mansour, a Sunni from Baghdad. "The local police do not have the capability for it. Most of them are from Mosul, and they are from the same tribes."

Nationally, the predominantly Shiite federal police became notorious during the sectarian conflict of 2006-2007, when officers allegedly worked alongside Shiite militias that kidnapped and murdered thousands of Sunnis. Interior Minister Jawad Bolani has since purged many of the most ardently sectarian commanders. But little has been done to change the heavy Shiite dominance.

Further stoking sectarian tensions was the April discovery of a secret prison in Baghdad where Sunni terrorism suspects — mostly from Mosul — were tortured. The prison was shut under U.S. pressure.

Now, the federal force of about 46,000 is viewed as generally effective, according to a 2009 U.S. Defense Department report to Congress. The local police, now numbering about 300,000 around the country, were judged far from adequate, the report said.

Local police, according to the report, "still had low competence, showed little initiative, faced massive problems with corruption, and only about half of their assigned personnel had any real training."

On top of all this, there are the problems of the Kurdish Peshmerga militia that fought Saddam's dictatorship, and the Sahwa, an alliance of Sunnis who switched sides in 2006 to join the Americans in fighting the insurgency.

Peshmerga guard Whalid Mohammed Nouri stands silently at a traffic checkpoint east of Khanikin, in Diyala province, unable to talk to the Iraqi army soldier next to him. Nouri speaks Kurdish and the soldier Arabic, so they communicate almost entirely in gestures.

The Peshmerga, which translates roughly as "those who face death" and were named as guerrillas fighting Saddam's dictatorship, are the security force of Iraq's Kurdistan region, an estimated 127,200-strong and the only army on the borders with Turkey and Iran. They also fiercely guard a boundary along oil-rich parts of Iraq's north that has been disputed for decades.

Fearing tensions between Kurds and Arabs could boil over into deadly violence, the U.S. this year designed checkpoints run by American, Iraqi and Kurdish forces in the disputed areas, united against a common enemy — insurgents.

But there's no guarantee the checkpoints will remain once the remainder of U.S. forces leave in 2011, and there's no end in sight to the disputes between the central government in Baghdad and the Kurds. The fear of Kurdish-Arab civil war so worries Odierno that he has floated the possibility of a U.N. peacekeeping force moving in.

The Peshmerga are resentful about the better pay and equipment of the Iraqi army, and "shoving matches" are not uncommon, says U.S. Army Lt. Col. Joseph Davidson.

"The pay for the Iraqi army and police is good, and they get uniforms and weapons," said Peshmerga Lt. Azeezkhan Mohammed Tagedyn, commander at a village checkpoint. "But ... we have to use our own money. I bought this AK-47, this vest, this uniform."

Only recently has Baghdad signed an agreement with the Kurdistan regional government to give the Peshmerga training comparable to the Iraqi army's. But the militiamen "still have a long way to go," said Davidson. "They've just started getting equipment and have had no formalized training."

Even one of the security success stories from the seven-year war is at risk as the Sahwa, or Awakening Councils, who are also known as the Sons of Iraq, largely have been benched in the fight.

The 100,000-strong Sahwa was supposed to be integrated into the security forces. But the vast majority have been relegated to desk jobs that have little to do with security, stoking resentment as scores have been killed by insurgents who see them as U.S. agents.

"These heroes are not willing to fight al-Qaida because they have not received what they deserved," said Sheik Efan Saadoun, a provincial councilor in Anbar, the birthplace of the Sahwa militia.

U.S. officials cite opinion polls showing most Iraqis have faith in their security forces, and Lt. Gen. Michael D. Barbero, who oversees U.S. military trainers, predicts they will at least be able to protect the country — even if they are far from perfect — by the time American troops are scheduled to fully leave at the end of 2011.

Yet many Iraqis remain skeptical.

Most members of the forces "are not professional and can't get rid of their sectarian feelings," said Ahmed Khudier, 47, a Baghdad Sunni. "Despite all of their misdeeds and mistakes, we regard the American forces as a safety valve and we fear security will deteriorate after the U.S. withdrawal."

Gen. Babaker Shawkat Zebari, the Kurd who commands Iraq's military, is said by aides to have an uneasy relationship with al-Maliki and plans to retire as soon as a replacement is found. He thinks the U.S. military should stay until Iraq proves capable of defending itself — which he said could take until 2020.

"Look at the Turks, the United Arab Emirates, Qatar, Bahrain," he said in an interview last month. "All of these countries have American bases under bilateral agreements. And I don't think we should be afraid of that idea."