Two of the masked gunmen detonated their suicide vests while cadets were sleeping, injuring more than 100 others in the well co-ordinated assault late on Monday.
The third was shot dead by security, bringing an end to the five-hour siege, officials said.
More than 200 police trainees were stationed at the facility in the city of Quetta when militants stormed inside and opened fire.
One cadet who survived told local media: "Militants came directly into our barrack. They just barged in and started firing point blank.
"We started screaming and running around in the barrack."
At least three explosions were reported at the scene by local media.
Mir Sarfaraz Bugti, home minister of Baluchistan province, of which Quetta is the capital, said the gunmen attacked a dormitory inside the training facility while cadets rested and slept.
He said: "Two attackers blew up themselves while a third one was shot in the head by security men."
A Reuters photographer at the scene said authorities carried out the body of a teenage boy who they said was one of the attackers and had been shot dead by security forces.