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.
The students then barricaded themselves inside the classroom, pushing chairs and desks against the door, and staying on the floor. Hossaini said at least two grenades were thrown into the classroom, wounding several of his classmates.
Hossaini and about nine students later managed to escape from the campus through an emergency gate.
"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.
Hedayatullah Stanikzai, an official with the Ministry of Public Health, said a guard employed by the university had been killed and that the wounded included a foreign teacher. University authorities could not immediately be reached for comment.
University President Mark English earlier told
The Associated Press that security forces had arrived on the scene soon after the attack began around 7 p.m. (1430 GMT), saying "we are trying to assess the situation."
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.
Police spokesman Sediq Sediqqi said security forces were conducting a clearing operation to track down the "terrorists." He said it was still not clear if there were one or two attackers.
All other personnel on the campus were being evacuated, he said. He had no further details on the nature of the attack.
The Pentagon said U.S. military advisers were on the ground with Afghan security forces at the university. Spokesman Adam Stump said the forces had been embedded with the Afghan units.
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 university was established in 2006 to offer liberal arts courses modeled on the U.S. system. More than 1,000 students are currently enrolled in degree courses.
The U.S. State Department condemned what it called "an attack on the future of Afghanistan."
"We are in the process of accounting for all chief of mission personnel and working to locate and assist any U.S. citizens affected by these attacks," it said, adding that it had no further information.
The Taliban have been fighting to overthrow the Kabul government for 15 years, and regard foreign civilians as legitimate targets.
Associated Press writers Rahim Faiez and Amir Shah in Kabul, Afghanistan, and Lolita C. Baldor in Washington contributed to this report.
Copyright 2016 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.