TOKYO — A child and three elderly people were killed by a strong earthquake that struck a bustling metropolitan area in western Japan on Monday.

The magnitude 6.1 quake brought down walls in Osaka and surrounding areas — and raised fears of landslides, the Japanese Meteorological Agency said.

More than 300 other people were injured.

Meteorological agency official Toshiyuki Matsumori warned aftershock tremors are expected and could occur for up to three days after the initial quake.

"Unless it's absolutely necessary, everyone should avoid entering dangerous areas and take precautions to ensure your own personal safety," he told Japanese broadcaster NHK.

A crack on a buckled road fills with water after an earthquake broke pipes in Takatsuki, Japan, on Monday. Keiji Uesho / AP

The four deceased victims included a nine-year-old girl who died when a school wall made of concrete blocks partially collapsed in Takatsuki City. A man aged in his 80s was killed by a collapsing brick wall in Osaka City while another man in his 80s died after being struck by a bookshelf in his home in Ibaraki City.

The most recent confirmed death was an 81-year-old woman who died in her home after a wardrobe fell on her.

The temblor reminded many in Japan of the magnitude 7.3 Hanshin-Kobe quake that killed more than 6,000 people in the same region in 1995.

Train passengers walk along railroad tracks following an earthquake in Osaka, Japan, on Monday. AFP - Getty Images

Monday's quake also followed a series of smaller quakes near Tokyo in recent weeks.

Linda Givetash reported from London, and Arata Yamamoto from Tokyo.