Mayor Sara Duterte-Carpio of Davao ordered the cancellation of all classes in public and private schools, saying the quake “may have caused structural and electrical damage to buildings and houses” in the city. Ms. Duterte-Carpio is the daughter of Rodrigo Duterte, the Philippine president.

Civil defense officials reported that 10 schools and more than 1,200 homes were destroyed by the quake, and more than 500 schools and 5,000 homes sustained some damage.

Two of the victims were a 67-year-old construction worker who was helping rebuild an evangelical church and a 15-year-old student who was hit by debris at a school near the quake’s epicenter.

The earthquake was the second powerful quake to strike Mindanao in two weeks. A 6.3-magnitude quake struck the island on Oct. 16, killing at least five people.

“The location is almost the same as the one on Oct. 16,” said Erlinton Olavere, a research specialist at the Philippine Institute of Volcanology and Seismology. “There is an existing fault” in the area, he said, adding that “the movements are still ongoing.”