The blast brought down the ceiling of the mosque in Mussayab, 60km (40 miles) south of the capital Baghdad. Police said some bodies were still trapped beneath the debris. At least 50 people were wounded.
Those inside had been mourning the death of a man killed a day earlier by militants.
"Until now, we are trying to retrieve bodies from under the debris. Most of the bodies were torn to pieces. Legs and hands were scattered on ground," said a policeman at the scene.
It was not immediately clear who was behind the bombing, which is the latest in a spate of attacks targeting both Sunni and Shi'ite places of worship, particularly during funerals.
Iraq's delicate sectarian balance has come under growing strain from the civil war in neighboring Syria, where mainly Sunni Muslim rebels are fighting to overthrow a leader backed by Shi'ite Iran.
Both Sunnis and Shi'ites have crossed into Syria from Iraq to fight on opposite sides of the conflict.
Al Qaeda's Iraqi and Syrian branches merged earlier this year to form the Islamic State of Iraq and the Levant, which has claimed responsibility for attacks on both sides of the border.
Suicide bombings are the hallmark of al Qaeda.
Several other attacks in recent weeks also suggest that Shi'ite militias, which have so far largely refrained from retaliating, may once again be resorting to violence.
More than 6,000 people have been killed in acts of violence since the start of the year, according to monitoring group Iraq Body Count.