JAKARTA, Indonesia -- A moderately strong earthquake shook the Indonesian island of Java on Tuesday, damaging buildings near the epicenter and shaking office buildings in the country's capital.

There were no immediate reports of injuries and no tsunami was generated.

According to the U.S. Geological Survey, the magnitude 6.0 quake was centered off western Java at a depth of about 27 miles. The epicenter was about 95 miles southwest of Jakarta, the capital.

Get Breaking News Delivered to Your Inbox

Zainal, who heads Banten province's search and rescue agency, said the quake damaged houses and other buildings in Lebak district, including a high school and hospital, and a mosque in Pandeglang district collapsed.

Buildings in the capital swayed for 10 to 20 seconds and some ordered evacuations, sending streams of people into the streets.

TVOne television showed workers and shoppers running out of a mall in central Jakarta in panic.

Witnesses told TVOne that houses were damaged in coastal areas of West Java, where many people ran to higher ground, fearing a tsunami.

Indonesia's Department of Meteorology, Climate and Geophysics said the quake didn't have the potential to generate a tsunami and no warning was issued.

Indonesia, the world's largest archipelago, straddles the Pacific "Ring of Fire" and is prone to earthquakes and volcanic eruptions.