District of Columbia: NATO military advisers are helping Afghan forces respond to an attack on the American University of Afghanistan in Kabul on Wednesday, a US official said.

Explosions and gunfire rocked the university when it came under fire from militants. No one has immediately claimed responsibility.

"A small number of advisers from the Resolute Support mission is currently assisting Afghan forces as they respond," US military spokesman Colonel Michael Lawhorn said in a statement.

NATO has about 13,000 service members in Afghanistan under its Resolute Support training mission. The majority of them are American.

"These advisers are not in a combat role; they are advising their Afghan counterparts," Lawhorn said, without specifying how many troops were involved.

Afghan security forces have since the start of 2015 been in charge of their country`s security, but have often struggled to control a resurgent Taliban and still need frequent help from US and NATO forces.

Dozens of Afghan special forces cordoned off the area after the attack started Wednesday evening, when the private university is usually packed with students, many of them working professionals doing part-time courses.

The attack comes after two professors at the university -- an American and Australian -- were kidnapped in the heart of Kabul earlier this month, the latest in a series of abductions of foreigners in the conflict-torn country.