The blast occurred on Friday after the end of the main weekly prayers.
Local police and witnessess said the bomb exploded outside a small mosque in a residential area. Officials at a nearby hospital said they knew of 39 people injured.
It was not clear whether it was a car bomb.
Baquba, 65 km north of Baghdad, is a hotbed of resistance to the US-led occupation of Iraq.
The attack comes a day after nine US personnel were killed when their military helicopter crashed in the hotbed city of Falluja. Witnesses said it had been brought down by a missile.
Mosques have been the target of violent attacks in the past.
A car bomb outside the main mosque in the Shia holy city of Najaf killed more than 80 people after Friday prayers last August. An explosion near a mosque in the mainly Sunni town of Falluja in June killed nine people.