The earthquake centered off Mindanao, the second most populous Philippine island, and injured nearly 500 people.