One of the attackers died early in the operation after detonating a suicide bomb but a second held out for several hours before being killed, provincial government spokesperson Attaullah Khogyani said.
A driver and two security guards were killed and seven people were wounded but 63 other people, almost all women, were rescued unharmed from the compound, which contained a training facility and a student residence.
Gunfire and sporadic explosions were heard during much of the day and clouds of black smoke rose from the area.
Blasts, gunshots reported in eastern Afghan city
There was no immediate claim of responsibility but a number of recent attacks have been claimed by Islamic State, which has a stronghold in the surrounding province of Nangarhar, on the border with Pakistan.
It was not immediately clear why the attackers had targeted the facility, which was mainly occupied by trainee midwives from the eastern province of Nuristan.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ