About 500 cadets live in a hostel at the academy.
Five or six "terrorists entered the training school and (went) straight to the hostel where they took cadets hostage," the Pakistani army said in a statement. It was unclear how many students were being held.
"The military has been deployed to the location," the army said.
Twenty people were injured early in the attack, most from bullet wounds, according to a police official who did not want to give his name because he is not authorized to speak to media.