Kabul police Chief Abdul Rahman Rahimi said the dead included one guard, and that about 700 students had been rescued.
Rahami said one foreign teacher had been wounded.
There were no immediate claims of responsibility for the attack on the university on the edge of Kabul. It was established in 2006 to offer liberal arts courses modeled on the US system, and has more than 1,000 students currently enrolled.
Police spokesman Sediq Sediqqi earlier said was still not clear if there were one or two attackers.
More From This Section
Dejan Panic, the program director at Kabul's Emergency Hospital, said 18 people wounded in the attack, including five women, had been admitted. He said three were "seriously" wounded, probably from automatic gunfire.
AP photographer Massoud Hossaini was in a classroom with 15 students when he heard an explosion on the southern flank of the campus.
"I went to the window to see what was going on, and I saw a person in normal clothes outside. He shot at me and shattered the glass," Hossaini said, adding that he fell on the glass and cut his hands.
"As we were running I saw someone lying on the ground face down, they looked like they had been shot in the back," he said.
Hossaini and the other students took refuge in a residential house near the campus, and were later safely evacuated by Afghan security forces.
The attack on AUAF comes two weeks after two university staff, an American and an Australian, were kidnapped from their car by unknown gunmen. Their whereabouts are still unknown.
The US State Department condemned what it called "an attack on the future of Afghanistan."
The Taliban have been fighting to overthrow the Kabul government for 15 years, and regard foreign civilians as legitimate targets.