The European Earthquake Monitoring Centre recorded the quake's epicentre at a point 22 km (14 miles) northwest of the city. Its website quoted a witness as saying the quake was "strong but fortunately not very long", while another compared it to a 'strong bounce' lasting about 15 seconds.
The Acropolis, a complex of ancient Greek buildings including the Parthenon located on a rocky hilltop overlooking the capital, was intact, according to the authorities. It is one of the world's most visited historical landmarks.
Reuters correspondents saw people evacuating buildings in the sprawling city, and hundreds crammed into Athens's central Syntagma Square.
Two people were lightly injured by falling debris, health ministry officials said. In the port city of Piraeus, an abandoned structure on a port quay collapsed.
The quake occurred at a depth of 15 km in an area affected by earthquakes in the past. Greece, along with Turkey, is among the most tremor-prone regions of Europe.
Seismologist Manolis Skordilis told Greece's Star TV: "The earthquake was close to the surface, which is why it was felt so much."
A fire brigade official said there had been several calls asking for help in rescuing people trapped in elevators, while some abandoned buildings were damaged.
Athens is a sprawling metropolis of almost 4 million people. "The situation is gradually subsiding. The city withstood this and can handle it. There is no cause for concern," said Nikos Hardalias, general secretary for Civil Protection.
Around 40 minutes after the first felt tremor, residents felt another strong quake, which the EMC rated magnitude 4.4, with an epicentre in the same region at the foot of Mount Parnitha.
In 1999, an earthquake of magnitude 5.9 in the same area killed 143 people.