According to the U.S. Geological Survey, the temblor hit at 8:07 a.m. with a depth of about 6.4 miles. The quake had a preliminary magnitude of 4.1, but it was downgraded to 3.8.
It was centered near the San Andreas Fault line about two miles northwest of Devore in San Bernardino County. Buildings swayed in downtown Los Angeles, about 60 miles to the west.
Eyewitness News received calls from viewers who said they felt the shaking in Rancho Cucamonga, San Bernardino, Victorville, Fontana, Hesperia, Apple Valley and Beverly Hills.
The USGS said a 2.0-magnitude aftershock hit about a half mile away about two minutes later.
There are no reports of damage at this time.
The California Highway Patrol reported no unusual incidents on Interstate 15 or Interstate 215, which merge in the Cajon Pass near the epicenter.
The Associated Press and City News Service contributed to this report.