The quake, which occurred at 2:57 p.m., was centered about 2 miles southeast of Pacifica, according to the USGS.
It was followed at 3 p.m. by a second, smaller earthquake with a magnitude of 1.4. That quake was centered about 2 miles southwest of San Bruno.
BART stopped its trains briefly to inspect the tracks after the first earthquake. Trains are running at normal speeds again, but 10-minute delays are reported system-wide.
Caltrain service was not affected, and operations were not altered at San Francisco International Airport.
The first quake was felt in parts of the Bay Area, including San Francisco and Oakland.
Thom Ball, library manager of the Pacifica Sharp Park Library, said he felt it.
"There was a sharp jolt that was preceded by a rumbling noise. That was it," Ball said.
"No books fell off the shelves. No lights went off. We all just felt it," he said.
Everyone seemed calm afterward, Ball said.
Michael Nee, a bartender at Behan's Irish Pub in Burlingame, said there were only two people in the bar at the time and that the quake was over in about three seconds.
"The whole bar shook. The lights from the ceilings swayed," Nee said.
He said there was a sound immediately before the quake.
"It was like a bang, or like a crack," Nee said.
Andrea Ormonde, who works in customer service for Bobkat Printing in San Carlos, said her coworkers noticed shaking but that she did not feel it.
"It happened just as someone was rolling by me with a cart," she said, laughing.
"People were running out their offices. Everyone was standing in the middle of the room, looking at me, asking, 'What was that?' I didn't even realize," Ormonde said.
The quakes occurred on the 105th anniversary of San Francisco's Great Quake of 1906.
The quake happened on a fault west of Pacifica that runs parallel to the San Andreas Fault. There had been a small jolt in the same area a few years ago, but it wasn't significant. Experts don't consider this a precursor to a larger one, but they are keeping an eye on that fault line. It is one that actually has not been named yet.
Nick's restaurant is located in Pacifica near Rockaway Beach. The manager there described what happened.
"The power did go out," said Nick's restaurant manager Thomas Schlied. "We have backup generators, emergency lights that come on and everything."
ABC7's Don Sanchez contributed to this report