Wildfires across Greece were largely contained on Thursday after razing swathes of forest and dozens of homes for days, though a new heatwave loomed, threatening to stoke tinderbox conditions across the country.

A fire west of Athens which prompted mass evacuations earlier in the week was contained, a fire brigade official said. Firefighters, backed with air water bombers, remained on site in case of a resurgence of flames.

On the island of Rhodes, firefighters continued to battle a blaze that had erupted in a densely wooded mountainous area and forced people to flee.

Greek meteorological service had warned of a heightened risk of fires from Thursday, as the country recovered from the first major heatwave of the summer.

A second heatwave was forecast to start on Thursday, with temperatures exceeding 40 degrees Celsius (104 degrees Fahrenheit) in some areas, and rising further on Friday to a maximum of 44C.

Land and aerial firefighting forces will continue preventive patrolling in forests across Greece amid difficult conditions, authorities said late on Wednesday.

Fires are common in Greece, but hotter, drier and windy summers have turned the Mediterranean into a wildfire hotspot in recent years.