A moderate earthquake and aftershock along the Hayward Fault on Thursday rattled buildings and jangled nerves, but otherwise caused little damage around the Bay Area.

There were no reports of injuries in the initial 4.0 temblor, which hit at 2:41 p.m. Thursday and was felt well south of San Jose and east of Sacramento. A magnitude 3.8 aftershock struck at 8:16 p.m. and also was widely felt.

The initial quake was centered beneath or near the UC Berkeley campus and knocked some merchandise off at least one store's shelves. BART temporarily stopped and slowed its trains as a precaution.

"It shook the campus nicely, but probably not too dangerous," said Peggy Hellweg, a seismologist at UC Berkeley's Seismological Laboratory. "I don't expect any major damage."

The U.S. Geological Survey said the first quake was centered on the Hayward Fault about six miles below the surface and appeared to be near the southern part of the campus, experts said.

An earthquake of that intensity can knock pictures off walls or damage windows, said Keith Knudsen, a geologist with the USGS in Menlo Park.

There were few reports of that happening, but in Oakland's Montclair district, merchandise did fall off shelves at McCaulou's Department Store, said Delia Aceves, an assistant manager.

"It felt like stuff was moving all around us," Aceves said. "It was going from side to side."

At least 20 customers were inside the store. The earthquake left many visibly scared, she said.

Berkeley police received several calls regarding alarms triggered by the shaking.

Everything was normal at UC Berkeley's Memorial Stadium, which is undergoing seismic upgrades, said a guard at a construction gate there.

"It was quick and no big deal," said the guard, who wouldn't give his name. "This is California; that was nothing."

The temblor was described as a moderate jolt in Walnut Creek and San Francisco, and in Vallejo it was described like minor waves on a boat.

People as far as Roseville, Gilroy and Santa Rosa reported feeling it.

The aftershock, centered about a mile east of Berkeley, was described as a rolling motion that lasted for about 15 seconds. Police and fire officials in Oakland said there were no initial reports of damage.

Earlier in the day, 8.6 million Californians participated in a statewide earthquake preparedness drill -- consisting of "drop, cover and hold on" -- sponsored by state and federal emergency response agencies, the American Red Cross and others.

"California is earthquake country, and we have earthquakes every day," Mark Benthien, executive director of the Earthquake Country Alliance, which organized the Great California Shakeout.

Hellweg said the temblor was nowhere near enough to significantly reduce stress on the Hayward Fault.

Could it be a preview of a bigger one? Hellweg said she won't worry.

"It could portend a larger earthquake, but the probability of that is fairly small," Hellweg said. "I don't lose any sleep over that."

It was the largest earthquake in that region of the Hayward Fault in several years, she said. Seismologists estimate a two-in-three chance of an earthquake of magnitude 6.7 or higher in the Bay Area in the next 30 years.

Staff writers Peter Hegarty, Kristin Bender, Angela Woodall, Karl Mondon, Doug Oakley, Matthias Gafni and Matt Krupnick contributed to this report.