Authorities said the bomb exploded in a madrassa in southwestern Qilla Saifullah , a town near the Afghan border in the province of Baluchistan .