Two people were killed and 21 wounded after the American University in Afghanistan was attacked Wednesday in the country's capital of Kabul, according to a source in the Kabul Police Force.

According to reports, 500 students and teachers were trapped for hours as security forces and attackers exchanged gunfire. The large group was rescued by local and national forces.

Afghan security forces killed two gunmen who attacked the American University in Kabul, police confirmed early Thursday. The two gunmen have not been identified.

Pulitzer Prize-winning Associated Press photographer Massoud Hossaini tweeted that he and others were trapped inside the school during the attack. Hossaini tweeted that he heard shooting and an explosion, but he later tweeted that he was able to escape.

The American University of Afghanistan is Afghanistan's first private, not-for-profit institution of higher education, and has an enrollment of more than 1,700 full-time and part-time students.

The school's webpage said that it "embraces diversity and community" in Afghanistan.

The school was a victim of another violent incident in August. Two professors at the university, one American and one Australian, were abducted at gun point outside of its campus on Aug. 8.