A civilian motorist was also killed and another wounded by crossfire during the assault on the outpost near Adhaim, 70km north of Baghdad. There was no account of casualties among the gunmen.
In a website statement, al-Qaida in Iraq claimed responsibility for the action, which it said started with a suicide car bomb attack on a checkpoint.
In other attacks, up to 10 people were killed and four wounded when a suicide bomber blew himself up outside a Shia mosque in Balad Ruz, northeast of Baghdad, and two US soldiers died when a roadside bomb hit their vehicle in the capital.
In a separate development, Aljazeera reported that six Sudanese, including the second secretary at the Sudanese embassy in Baghdad, were kidnapped in the capital shortly after Friday prayers.
One of the hostages then made contact with the embassy, which informed the foreign ministry in Khartoum.
Jamal Mohammad Ibrahim, a Sudanese foreign ministry spokesman, told Aljazeera that he did not know who had kidnapped the six and appealed for their immediate release.
The Adhaim attack was the latest in a series of large-scale assaults over more than a year that demonstrate the military training of the fighters and their ability to co-ordinate.
Lacking sophisticated armour or equipment, Iraqi police and soldiers are among the most exposed to attacks by insurgents.
As mortar bombs landed on the main army base in Adhaim at dawn, police said, gunmen started their attack on an outlying post some 10 km (six miles) to the north, on the main road to Kirkuk, firing rocket-propelled grenades and heavy machineguns.
When reinforcements finally arrived, the rebels turned on them too, a senior police officer in the area said. In all, the fighting raged for several hours before the attackers broke off.