A magnitude 6.3 earthquake struck off the coast of southwest Mexico near the Guatemalan border on Tuesday, the U.S. Geological Survey said.