The powerful earthquake struck off the coast of the island of Mindanao, destroying buildings and prompting a tsunami threat across the wider region.