A bomb outside a Shiite mosque in northwest Pakistan killed at least four people and wounded five Monday, police said.

The bomb exploded near the outer wall of the mosque in downtown Dera Ismail Khan city as worshippers were leaving after evening prayers, said Abdul Ghafoor, a local police officer.

The blast shattered the mosque's front wall and damaged its dome. Twisted fans hung from the ceiling inside the mosque and prayer mats were scattered across the bloodstained floor.

Police cordoned off the area as people sifted debris looking for survivors. An Associated Press reporter saw a crater near the shattered wall where the bomb went off.

Ghafoor said four people died in the bombing and five were wounded, three seriously.

Pakistan is struggling to combat a tide of Islamic militancy, particularly in its volatile northwest. It has a history of violence between the majority Sunni and minority Shiite Muslims.

While most members of the two sects coexist peacefully, violence by extremist elements is common.

Last month, gunmen opened fire on a car, killing four Shiite Muslims in Dera Ismail Khan. Hours later, a Sunni was shot dead elsewhere in the city.

The Sunni-Shiite schism originates in a dispute dating back to the seventh century over who was the true heir to Islam's Prophet Muhammad.