A magnitude 7.6 earthquake has struck southern Panama, shaking Panama City and prompting a tsunami threat for five Pacific nations.