The killings at the barracks in the village of Ayn al-Jahish outside the northern city of Mosul represent the latest blow to the government's efforts to achieve stability in restive Sunni-dominated areas.
Gunmen staged the assault late last night, two police officers said, shooting some at short range while others died when insurgents stormed the barracks.
A medical official, who confirmed the causality number, said 11 troops had their hands tied behind their backs and suffered close-range gunshots to the head.
The slain troops are in charge of protecting an oil pipeline that sends Iraqi crude oil to international markets and guarding a nearby highway.
More From This Section
Attacks on this pipeline are common in that area near Mosul, a former insurgent stronghold located about 360 kilometres northwest of Baghdad.
The brazen attack comes amid a surge in violence to levels unseen in Iraq since 2008. It's been the most serious challenge to the Shiite-led government's efforts to achieve stability.
Last year, Iraq saw its highest annual death toll since the worst of the country's sectarian bloodletting began to subside in 2007, according to United Nations figures. The UN said violence killed 8,868 last year in Iraq.