Alexis Tsipras, looking pale, said after cutting short a visit to Bosnia.
Greece has sought global assistance to cope with the fires near the capital, which have destroyed dozens of homes, burned cars and prompted tourists and Greeks to flee to beaches east of Athens for dramatic rescues by boats.
Greek authorities are rushing to evacuate residents and tourists stranded on beaches along the coast after some were caught by the flames in their cars or on foot trying to reach the sea.
The fires broke out Monday and tore through a coastal area northeast of Athens popular with tourists and beachgoers. The rest of the survivors were picked up by a fishing boat with an Egyptian crew who jumped into the water to rescue them.
Flames fanned by strong winds have devastated the village of Mati near Athens and there are fears that the number of dead will rise as it is not known yet how many people remain missing.
"It is disgusting to see the person next to you drowning and not be able to help him", he said.
This week's fire is the deadliest in Greece since 2007, when 60 people were killed in a wildfire in the southern Peloponnese region, according to the Associated Press.
Romania's defense ministry says it has sent two planes and personnel to aid firefighting efforts in Greece. The mayor added that the infrastructure of the city of Mati, where there were the most deaths, destroyed by fire by 98%. It saved my life.
Georgia Trismpioti, a senior humanitarian affairs officer for the International Federation of Red Cross and Red Crescent Societies (IFRC) in Athens, said: "Hellenic Red Cross volunteers are continuing to provide first aid and search and rescue activities in and around Mati, and they have been there since the very first hours of this devastating wildfire".
"I took my baby and ran to the sea, while my wife - I didn't know what happened".
Dimitri Piros, director of medical services for Ekav, Greece's nationwide ambulance service, told the BBC that people had suffered horrific injuries because of the speed of the fire. "We managed to find a small gap and we made it out".
"We left at the last minute".
Greece is seeking assistance from the European Union to battle the fires.
In all, 47 brush and forest fires broke out across Greece on Monday and early on Tuesday, with majority quickly extinguished, the fire department said.