A homicide bomber rammed his explosives-laden truck into a sandbagged wall surrounding a police headquarters in northern Iraq on Friday, killing five American soldiers and two Iraqi policemen in the single deadliest attack against U.S. forces in more than a year, the U.S. military and Iraqi police said.

A sixth American soldier and 17 Iraqi policemen were wounded in the blast that took place near the national police headquarters in southwestern Mosul — Iraq's third-largest city and Al Qaeda's last urban stronghold.

homicide bombings — a hallmark of Al Qaeda's attack style — continue to threaten the city, which U.S. troops must leave by June 30 under an agreement with the Iraqis. The approaching deadline has raised fears about what will happen after American soldiers depart.

Lt. Col. Michael Stuart, chief of U.S. operations in Tikrit, an Iraqi city north of Baghdad, said the target was the Iraqi national police complex in Mosul and not the U.S. patrol. He said the American patrol just happened to be on the same street when the attack occurred.

"It was just bad timing," Stuart told The Associated Press.

Friday's blast was the deadliest single bombing attack in more than a year. The U.S. military said that the last time five U.S. soldiers were killed in an attack was when a homicide bomber targeted an American patrol in Baghdad on March 10, 2008.

A homicide car bomb struck a U.S. patrol in Mosul on Feb. 9, killing four American soldiers and their Iraqi interpreter. Four U.S. soldiers were also killed Jan. 26 when two helicopters collided over the northern city of Kirkuk.

Friday's homicide bomber, who was driving a truck filled with grain, made a sharp turn as he approached the police complex, then rammed his truck through an iron barrier, hitting a sandbagged wall beyond it and detonating his vehicle near the station's main building, Iraqi police said.

The blast shook the entire complex and badly damaged nearby buildings, witnesses and police said.

A policeman, who identified himself as Abu Mohammed, said he saw the truck driving behind two U.S. Humvees on the street leading to the police headquarters. The Humvees entered the complex, came to a stop, and within seconds, the truck turned and rammed the iron barrier, he said.

Iraqi police opened fire, but the truck kept moving until it reached the sandbagged wall where it detonated — just a few feet away from the Humvees, he said.

"The blast was very powerful and the situation was chaotic," he said.

The U.S. military said two people were detained in connection with the attack, which is under investigation. The names of those killed were being withheld pending notification of families.

Although U.S. combat troops have to leave of Iraqi cities by the end of June under the U.S.-Iraqi security agreement that went into effect this year, the top U.S. commander in Iraq, Gen. Raymond Odierno, told The Times of London this week that the American troops may have to stay in Mosul and another northern city, Baqouba, after the deadline because insurgents remain active there.

Mosul, about 225 miles (360 kilometers) north of Baghdad, had been relatively quiet in recent weeks compared to the Iraqi capital, where attacks killed at least 53 people this week.

American casualties have fallen to their lowest levels of the war since thousands of Sunnis abandoned the insurgency and U.S. and Iraqi forces routed Shiite militias in Baghdad and Basra last spring.

However, fighting continues in Mosul and elsewhere in northern Iraq — a conflict that U.S. officials say is driven in part by ethnic rivalries between Sunni Arabs and Kurds. Many Sunni extremists are believed to have fled north after being driven from longtime strongholds in Baghdad and central Iraq.

In a separate attack on Friday, a U.S. patrol of Striker vehicles was targeted by a roadside bomb, but no one was hurt in the blast near Taji, about 12 miles north of Baghdad, said spokesman Maj. Dave Shoupe. Taji police said eight Iraqi laborers paving a road by the site of the blast were detained for questioning.

Meanwhile, Iraqi police in the southern city of Basra said Friday they arrested 65 people in overnight raids after an attack on a U.S. convoy in the area and the kidnapping of two guards working for a local Iraqi security firm the previous day.

The arrested included 20 people who were already on a wanted list and 45 others, mostly militiamen, said the city's police spokesman Col. Karim al-Zeidi.

The U.S. military said the American convoy was hit by a roadside bomb near Basra on Thursday, but there were no casualties. Separately, al-Zeidi said two guards working for an Iraqi security firm were abducted late Thursday from their car, which was left by on the side of the road near Basra along with the guards' weapons.

Their identities and the company they worked for were not immediately known.