People are evacuated from an office building in Beijing in this photo taken on May 12, 2008.
The tremor, measuring 3.9 on the Richter scale, jolted the Tongzhou District at 2:35 p.m.
Lisa Wang, an office worker in Oriental Plaza in downtown Beijing, said the whole building was evacuated after the tremor.
"My colleagues, more than 50 people, rushed downstairs from the sixth floor into the plaza in front of the building. A large number of people, other office workers, were already there and more people poured out," she said.
She said hundreds of people stayed outside for about 15 minutes before returning to their offices.
"I still feel dizzy; I don't know if it's just psychological," said the 23-year-old Wang. "But the situation is generally calm. We are all back to work now."
The quake was also felt in Tianjin, about an hour's drive from Beijing, according to reporters from Xinhua's branch there.
The epicenter was initially determined to be 39.8 degrees north latitude and 116.8 degrees east longitude, according to the China Seismological Forecast Network. The network is part of the State Seismological Bureau.
There were no immediate reports of casualties or damage.