The explosion occurred as cadets were leaving the officer training college. (FILE PHOTO)

A suicide bomber blew himself up at the entrance to a military training centre in the Afghan capital on Thursday, killing at least six people and wounding six, police and security officials said.

One official, who spoke on condition of anonymity, said the attacker detonated his explosives after being prevented from entering the Marshal Fahim National Defense University, to the west of Kabul.

The explosion occurred as cadets were leaving the college, which is one of Afghanistan's main officer training academies.

There was no immediate claim of responsibility for the attack, which came as Taliban representatives met senior Afghan politicians in Moscow as part of efforts to reach a settlement to end the 18-year-long conflict.