A magnitude 7.1 earthquake struck 40 kilometers northwest of the Pacific island of Guam on Wednesday, the U.S. Geological Survey said.