At least 28 people have been killed in an attack on a military academy in the Libyan capital, the health minister of the Tripoli-based government said.

Read alsoReuters: Trump vows to hit 52 Iranian targets if Iran retaliates after drone strike

"An air raid on the military school of Tripoli killed 28 cadets and injured dozens more," Amin al-Hashemi, spokesman for the health ministry of the United Nations-recognised Government of National Accord (GNA), said on Saturday, according to Al Jazeera.

At the time of the attack, the cadets were gathered on a parade ground before going to their dormitories, he added.

Forces allied with the GNA described Saturday's attack on the military camp at Al-Hadhba as "an aerial bombing" launched by their eastern rivals.