Turkey on Sunday "strongly condemned" an airstrike on a military school in the south of the Libyan capital of Tripoli by jets loyal to renegade military commander Khalifa Haftar.

At least 30 people were killed and 33 injured on Saturday in the strike on the dormitory of the military school, targeting mainly its students.

It is essential for the international community to take the necessary steps as soon as possible to stop the attacks by Haftar's so-called Libyan National Army and to provide a ceasefire in Libya, as well as to put an end to external support provided to Haftar, the Turkish Foreign Ministry said in a statement.

Condoling those killed and wishing speedy recovery to the wounded, the ministry underlined that Turkey would continue to pursue efforts in solidarity with the UN-recognized Government of National Accord (GNA).

Since the ouster of late leader Muammar Gaddafi in 2011, two seats of power have emerged in Libya: Haftar in eastern Libya supported mainly by Egypt and the United Arab Emirates, and the GNA in the capital Tripoli, which enjoys UN and international recognition.

Turkey's parliament passed a motion allowing the deployment of troops in Libya for one year in order to respond to threats from illegitimate armed groups and other terror groups targeting both countries' national interests.

The resolution also aims to provide security in Libya in the face of any possible mass migration and to provide Libyans with humanitarian aid.

Turkish forces will be able to launch an "operation and [military] intervention" to protect Turkey's interests and prevent future irreparable situations.