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.
State Gov. Marcos Covarrubias announced that classes at public schools in the state would be cancelled Wednesday so experts can evaluate any possible damage to school buildings.
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, along with a 4.8 temblor about 8 miles (14 kilometers) further out in the Gulf of California about 12 minutes later.