SYDNEY, Australia — Punishing winds, torrential rains and powerful ocean swells have inundated large areas of Australia’s two most populous states, driving thousands of people from their homes and killing at least four people.

The floods add one more blow to a barrage of bizarre and destructive weather in the country, which was in the grip of a searing four-month heat wave and scores of huge wildfires before the remains of Tropical Cyclone Oswald made landfall late last week.

As the storm system crept south along the east coast from Brisbane in Queensland all the way to Sydney in New South Wales, more than 500 miles away, it dumped record amounts of rain in many areas, isolating dozens of communities and snarling traffic in the air and on land. More than 53 inches of rain fell in three days in some areas.