The explosion ripped through the school in Qilla Saifullah, a town about 90 miles north of Quetta, the capital of Baluchistan province, police official Mohammed Farooq said.
The bomb exploded in a room soon after an Afghan refugee, who stayed there for the night as a guest, had left, Farooq said.
Four students were killed at the scene while two died later. Four were wounded, Farooq said.
Baluchistan shares a long border with Afghanistan, where Taliban militants are battling government, U.S. and NATO forces.
The province is also beleaguered by a low-level insurgency in which ethnic Baluch rebels are seeking greater autonomy and control over resources such as rich gas reserves.
Manzoor Hussain, police chief in Qilla Saifullah, said it was unclear if the explosion was linked to either conflict.