An Iraqi defence ministry statement said the attack occurred in the morning at Tarmiya, about 25km north of Baghdad.
Earlier reports said six mortar rounds were fired at the offices.
"Four Iraqi National Guards were killed and up to 80 wounded in a mortar attack on an Iraqi National Guard base," a US military spokeswoman said.
The Iraqi National Guard has been a target of armed groups trying to undermine US-led security efforts in advance of November national elections.
US contractor killed
In central Baghdad, one US contractor was killed and seven people wounded, including an American soldier, in an attack on a US army compound on Tuesday, a military spokesman said.
"We had mortar and RPG (rocket propelled grenade) fire that hit inside our compound this morning," the spokesman said.
Oil pipelines are often sabotaged
The US soldier and one of the six Iraqi civilians injured were in a serious but stable condition, he said.
The Iraqi nationals had all been working in the compound.
In Ramadi, US troops clashed with fighters in the city's centre, with fierce fighting taking place near the City Hall, witnesses said on Tuesday.
A Humvee was damaged when it was hit by a homemade bomb and rocket fire, according to witness Hatif Mahmud. It was uncertain whether there were any US casualties.
In northern Iraq, saboteurs attacked and set on fire a key oil pipeline that connects the Beiji oil refinery with Turkey, police said on Tuesday.
The pipeline was hit with explosives late on Monday, Aljazeera has learned. The pipeline transfers crude oil to the Turkish Jihan field.
Charity head abducted
Care International charity said its head of operations in Iraq had been abducted in Baghdad.
A spokeswoman said that Margaret Hasan, who has been working for the charity in Iraq for more than a decade, was taken on Tuesday morning, but could give no further details.
"We do want to stress that she is an Iraqi national, not a Briton. She has been living there for many years," the spokeswoman said.
Care International is one of the world's largest independent global relief and development organisations. It operates in more than 72 countries in Asia, Africa, Latin America, the Middle East and eastern Europe.
Hasan, who has lived in Iraq for about 30 years, has been working for the charity since it started operations there in the early 1990s.