The US Geological Survey said the quake had a preliminary magnitude of 6.8 when it hit on Friday night, with shaking that lasted several seconds.