According to Xinhua, the top UN official in a post on X, formerly known as Twitter, strongly condemned the strike. Saying his heart is "with the families of those who died."
He stressed that hospitals and all medical personnel are protected under international law.
He also condemned an attack earlier on Tuesday on a school run by the UN Relief and Works Agency for Palestine Refugees (UNRWA), which killed at least six people, his spokesperson said in a statement.
Al Ahli Arab Hospital was operational, with patients, health and caregivers, and internally displaced people sheltering there, the World Health Organization said in a statement.
It was one of 20 hospitals in the north of the Gaza Strip facing evacuation orders from the Israeli military.
The Health Ministry in the Hamas-governed territory accused the Israeli military of launching an airstrike on the hospital in Gaza City.
Displaced civilians were reportedly seeking shelter at the hospital, following Israel's order to evacuate to the south in advance of what is expected to be a ground assault.
Gaza has a population of roughly 2 million and the crisis has displaced some 600,000 people, many of whom have sought safety in hospitals which are already overwhelmed with rising casualties and deaths.
The United Nations said that essential supplies such as food, water, and vital health medications are depleting in Gaza. Out of 35 hospitals, four are inoperable because of significant damage and direct targeting.
AMK/PR