A church spire and a corridor in the main hospital also collapsed, forcing some of the injured to be treated at a community health centre.
The US Geographical Survey, which estimated the quake to be at magnitude 7, said the epicentre was in the Talaud islands, 323.5 km south-southeast of General Santos, on the Philippine island of Mindanao.
There were no reports of damage or casualties in the Philippines.
The Indonesian archipelago suffers frequent earthquakes, lying in an area of intense seismic activity where several tectonic plates collide.
Indonesian authorities lifted the tsunami warning later on Thursday.