No militant group has yet claimed responsibility. (Representational image)

An explosion on Friday near a gate to the campus of Kabul University in the Afghan capital killed six people and injured at least 27 as students waited to take an examination, officials said.

Afghan security forces are facing almost daily attacks by Taliban militants, despite reported progress in efforts by the United States to broker an end to Afghanistan's nearly 18-year war.

There was no immediate claim of responsibility for Friday's blast just hours after Taliban militants set off two car bombs outside police headquarters in the southern city of Kandahar, killing at least 12 and wounding more than 80.

Health ministry spokesman Wahid Mayar said there were students among the 27 injured taken to hospital after the blast, which a student at the university campus said took place while a number of students waited to appear for an exam.

An eyewitness and an interior ministry official said a vehicle caught fire after the explosion caused by a sticky bomb, a common threat in Kabul, where insurgents often stick explosives under vehicles.

A police team defused a second bomb placed near the explosion site, Kabul police spokesman Faramarz Firdaws said.