At least 50 people were killed in a suicide bombing near a mosque in Pakistan.