Police and members of an anti-al-Qaeda group opened fire as the attacker sped toward a joint U.S.-Iraqi checkpoint. But the bomber managed to detonate his explosives near some stores about 20 yards away, according to provincial police. The police said eight civilians were killed and 20 wounded.
The differing casualty figures could not immediately be reconciled.
The attack was one of a series in northern Iraq on Sunday.
Iraqi police said four civilians were killed when a tanker truck exploded near an Iraqi Army checkpoint south of Mosul, about 225 miles northwest of Baghdad.
Iraqi soldiers opened fire on the approaching tanker when it was about 30 yards from their post in an attempt to avert a suicide attack, an officer said on condition of anonymity because he was not authorized to speak to media. The tanker exploded, killing four civilians and damaging six cars nearby, he said.
The explosions came hours after suspected al-Qaeda-linked insurgents stormed two villages in northwestern Iraq. They were repelled by U.S.-allied fighters and Iraqi security forces in clashes that left at least 22 people dead, according to Sheik Fawaz al-Jarba, a Sunni lawmaker and the head of an anti-al-Qaeda group in Mosul.
The attack began about 5 a.m. when about 25 carloads of heavily armed gunmen drove into the villages of Khams Tlol (Five Hills) and al-Madina, about 50 miles west of Mosul, al-Jarba said.
He said villagers fought back against the militants, who were wielding rocket-propelled grenades, mortars and assault rifles. Clashes broke out that lasted about five hours.
An Iraqi army officer in Mosul, who spoke on condition of anonymity because he wasn't authorized to disclose the information, confirmed the attack and said the fighting ended after Iraqi soldiers joined the battle.
The 22 killed included 10 militants, six members of the area's awakening group that has joined forces with the Americans against al-Qaeda in Iraq, as well as four women and two children, the officials said. Ten civilians in all were wounded, they said.
The U.S. military confirmed that an attack on a compound housing some of its Sunni allies near Sinjar in northern Iraq killed five U.S.-allied fighters and wounded five others. Ten insurgents were killed, the military said.
Insurgents also attacked a group of civilians elsewhere in the northern Ninevah province on Sunday, killing two men and one child and wounding two other men, two women and two infants, according to the military.
Mosul, the provincial capital of Ninevah, is believed to be the last major urban stronghold for al-Qaeda in Iraq after many insurgents were driven north by U.S.-led offensives in Baghdad and surrounding areas.
Iraqi Prime Minister Nouri al-Maliki has promised a "decisive battle" against the terror network there but given no start date. The U.S. military has warned it will not be a swift strike, but rather a grinding campaign that will require more firepower.
An al-Qaeda front group for northern Iraq warned last week in an Internet statement that it was launching its own campaign in Mosul and surrounding areas and urged volunteers to join them to carry out suicide attacks on U.S. troops, Iraqi Shiites and the Kurdish peshmerga troops.