A bomb exploded at the entrance of a Shiite Muslim mosque south of Baghdad today as hundreds of worshippers gathered for prayers ahead of the breaking of the fast on the first day of Ramadan, killing at least 22 people and wounding 77, police and hospital officials said.