At least eight people were injured and more than 470 houses damaged when a 6.1 magnitude earthquake struck off Java, about 140km south-west of Jakarta, at about 1.35pm local time yesterday.
Offices and high-rise homes in Jakarta and in the surrounding areas were quickly evacuated as the quake and its aftershocks shook buildings.
Indonesia's meteorology, geophysics and climatology agency (BMKG) has ruled out the risk of a tsunami.
Lebak regency, in Banten province, is closest to the epicentre.
"Aftershocks were recorded at about magnitude 4, clearly showing a subsiding trend. We appeal to residents to not panic. Residents should go back to their normal activity," said Dr Daryono, head of earthquake information and tsunami warning at BMKG.
"At 61km depth, it is considered a medium depth and does not exert energy to spawn a tsunami," he added.
The United States Geological Survey said it was a 6.0-magnitude quake which struck at a depth of 43km.
Mr Muhammad Riyadi, head of the earthquake and tsunami department at BMKG, said the quake had two aftershocks measuring at magnitudes 4.1 and 4.
"Jakarta is a bit far from the epicentre. We don't anticipate any damage in Jakarta. No tsunami potential," Mr Riyadi said.
Residents in Jakarta, Bogor and Sukabumi reported that they felt the tremor.
Some firms in tall office buildings in Jakarta released their staff for the rest of the day.
"I felt it twice and the first one was stronger. We were in a car and it felt like someone from outside shook our car," Mr Hardi, a resident in Sukabumi, told Jakarta-based Elshinta radio.
In Banten and West Java provinces, 479 houses were damaged. There have been no reports of fatalities so far, said Dr Sutopo Purwo Nugroho from the national agency for disaster management, BNPB.
In Cianjur regency in West Java, six students were seriously injured, and two lightly injured when broken roof tiles fell on them, according to BNPB.
Indonesia sees frequent seismic and volcanic activity as it lies on the Pacific "Ring of Fire" where tectonic plates collide.
"Indonesia experiences about 360 earthquakes measuring above magnitude 5 every year. If we count all the earthquakes, small to big, then the number is more than 4,000 a year," said BMKG's Riyadi.