At least 18 of the people killed in the Pedrogao Grande district were fleeing by vehicle when they became trapped as flames swept over the road.
In a statement, the Secretary-General said he spoke earlier today with the President of Portugal, Marcelo Rebelo de Sousa, and with the Prime Minister, António Costa, expressing his "deep sadness".
"It is the greatest tragedy of human lives that we've witnessed in Portugal in years", Prime Minister Antonio Costa said in televised comments.
Portugal, like most southern European countries, is prone to forest fires in the dry summer months.
Gomes said that 14 civilians had been injured, 10 of them seriously, along with six firefighters.
Valdemar Alves, mayor of Pedrogao Grande, said: "This is a region that has had fires because of its forests, but we can not remember a tragedy of these proportions".
Spain dispatched two water-bombing planes on Sunday morning to aid the Portuguese fire service on the ground, the prime minister said.
The blaze on Saturday hit the mountainous area of Pedrogao Grande amid an intense heat wave and rainless thunderstorms.
Rodman begins sightseeing on NKorea trip he hopes opens door
Warmbier's plane landed at Cincinnati Municipal Lunken Airport at around 10.15 p.m. local time , according to a Reuters witness. Richardson said his center in Sante Fe, N.M. received a call Tuesday from the Warmbiers with an update on their son's condition.
On Saturday, a wildfire spread onto the town of Pedrogao Grande, about 120 miles north of Lisbon.
Portugal has been experiencing a heatwave, with temperatures of more than 40C (104F) in some areas.
More than 600 firefighters were still battling the flames on Sunday. "It is an authentic inferno, we have never seen anything like that", the mayor of Pedrogao Grande Valdemar Alves told reporters.
A burnt auto rests on a road shortly after a wildfire swept through central Portugal. He said there was no information on the other two deaths.
Police believe lightning striking a tree was probably the cause of the fire. "The EU is fully ready to help".
Resident Isabel Brandao told The Associated Press that she had feared for her life when she saw the blaze.
Authorities said the the conditions may have played a part. "I never thought it would come to this side", she said Sunday.