The attackers targeted the Shaikh Murad mosque and the Khanaqin Grand Mosque while people were attending Friday prayers. The police said the death toll could rise.
Khanaqin, located near the Iranian border 140km from the capital, is a majority Kurdish town.
Also on Friday, two car bombs exploded earlier in a central Baghdad residential neighbourhood, located between an Interior Ministry building and the al-Hamra Hotel occupied by foreign journalists. At least six people were killed and 43 injured in the blasts.
"What we have here appears to be two suicide car bombs(that) attempted to breach the security wall in the vicinity of the hotel complex and I think the target was the al-Hamra Hotel," US Brigadier-General Karl Horst told reporters at the scene.
The blasts - less than a minute apart -reverberated throughout the city centre, sent a mushroom cloud hundreds of feet into the air and was followed by sporadic small arms fire. At first the target appeared to be the Interior Ministry building nearby where US troops found about 170 detainees, some of whom appeared to be tortured.
Firefighters and US troops joined neighbours to dig through the debris and under toppled blast barriers to pull victims from the rubble.
Associated Press Television News footage showed that several residential buildings had collapsed from the blast and a large crater in the road.
But US soldiers said the attack was a copycat of a car bombing against journalists in the Palestine Hotel last month, with the first car bomb attempting to knock down the hotel's defensive wall and the second vehicle trying to penetrate the breach.
"They tried to knock down the wall to get to the hotel," said Sergeant-Major Stanley, who did not give his first name.
Defence workers tried to pull
victims out of the rubble
"There are a lot of casualties and a lot of damage."
Deputy Interior Minister Major-General Ali Ghalib said the Interior Ministry building was very close to the al-Hamra Hotel but he believed the hotel was the target.
"The hotel is fortified and the shelter is fortified," Ghalib said.
"It was random explosions because the suicide attacker could not reach the target and that is the reason why the damage was in a civilian building," he said.
"I think that the hotel was targeted because foreigners usually stay there," Ghalib said.
Also on Friday, armed men attacked US and Iraqi troops in western Iraq, setting off gunbattles that left 32 attackers dead, a US military statement said.
One marine and an Iraqi soldier suffered minor injuries during the attack, the US forces said. Most of the fighting took place around a mosque in the centre of the town.