A powerful bomb exploded at a mosque within a pro-Taliban seminary in northwestern Pakistan on Friday, killing at least five worshippers and wounding dozens of others ahead of the fasting month of Ramadan, according to local police.