Pakistani officials say a suicide bombing at a funeral for a policeman killed earlier in the day has left at least 27 people dead in the country 's restive northwest .