A homicide bomber in a pickup truck detonated his explosives outside a residential complex in northern Iraq on Tuesday, killing 22 people and wounding 30, police and hospital officials said. At least three children were among the dead.

The explosion occurred as Iraqi police and members of a volunteer force prevented the bomber from entering the gate of the compound belonging to the state-run North Oil Company in Beiji, about 155 miles north of Baghdad, a police officer said.

Most of those killed were civilians, and at least three were children, the police officer said. The dead also included guards of the oil company and members of the volunteer force, he said. He added that some of the residential buildings were damaged in the blast.

An official at the main hospital in Beiji gave the same casualty figures. Both officials spoke on condition of anonymity because they were not authorized to release information to the media.

Authorities imposed a curfew on the city until further notice.

Volunteer forces known as Awakening Councils -- groups of Sunni Arab fighters who have turned against Al Qaeda and are now funded by the U.S. -- have been credited with helping reduce violence in Iraq in recent months.

Although bombings and other attacks continue throughout the country, their number has fallen.