Authorities say gunmen have attacked an Iraqi army barracks north of Baghdad, killing 12 soldiers.

The attack happened Wednesday in the town of Udaim in Diyala province, just north of the capital.

A police officer said gunmen also used mortar fire in their attack, which also wounded seven soldiers.

A medical official confirmed the casualty figures. Both officials spoke on condition of anonymity as they weren't authorized to publicly release the information.

The attack comes as the government grapples with Al Qaeda-linked Sunni militants taking control of the western cities of Fallujah and Ramadi.