The attackers targeted Government High School Sarwar Wali in Dera Ghazi Khan district of Punjab province.
Two to three men gunmen opened indiscriminate firing after entering a government-run school, Geo TV reported .
"The security guard of the school was shot dead as the attackers entered the school by jumping the rear wall of the building," it reported.
Police personnel soon reached the location and engaged the attackers in a gun-fight, after which the attackers managed to escape.
Punjab police chief Mushtaq Sukhera said the incident was not related to terrorism.