Residents have since been forced to evacuate buildings in the capital as tremors are felt across the island.
The quake occurred around 65 miles west of the city of Sukabumi at a depth of 21 miles.
One eyewitness in Sukabumi said: “I was lying on the floor and suddenly felt a tremor, everything was shaking for about a minute I think.
“People got out of houses and children cried.”
TWITTER
CSEM
The DEADLIEST earthquakes of all time

Rudy Togatorop, who works in the Chilean embassy in Jakarta, wrote: “We felt the earthquake for three to five minutes.
“I was just sitting down, then I felt the building swaying. The emergency stairs were very narrow.
“I was worried if something would happen.”
One Twitter user in the capital wrote: “Woah! Earthquake in Jakarta. The building is still swaying.”
Indonesia sits on the Pacific “Ring of Fire”, where tectonic plates collide and cause frequent seismic and volcanic activity.