State civil defense director Carlos Rincon said there were no immediate reports of damages or injuries in La Paz, a tranquil fishing and resort city.
"We are calling on the public to remain calm in case there are aftershocks," Rincon said.
The U.S. Geological Survey said the quake was centered about 47 miles (75 kilometers) north-northeast of La Paz in Baja California Sur.
The USGS said the quake occurred at about 4:45 p.m. local time and was centered offshore in the Gulf of California.
About twenty minutes later, a 4.6-magnitude aftershock occurred about 24 miles (38 kilometers) north of La Paz. That quake was also centered in the Gulf of California.