Authorities said 54 people were injured, including four firefighters and an eight-year-old...
Spanish state television showed images from Portugal of several people on a road trying to escape the intense smoke, that had reduced visibility to only a few meters. He said there was no information on the other two deaths.
Portugal was sweltering under a severe heatwave over the weekend, with temperatures topping 40 degrees Celsius (104 degrees Fahrenheit) in several regions.
Some 700 firefighters have been working to tackle the flames since Saturday.
In recent years, Portugal has experienced numerous wildfires, but none like this. "It is a real inferno, we have never seen anything like that", the mayor of Pedrogao Grande Valdemar Alves told reporters, adding that more than 20 villages had been affected.
Portugal is prone to forest fires during the dry summer months.
Costa tweeted his "deepest regret for the victims. and a word of encouragement and strength for all who help combat this scourge".
The Pedrógão Grande fire is one of more than 60 fires that broke out overnight throughout the country, the BBC reported, and according to the New York Times, an additional 11 areas were under surveillance for an "extreme fire risk". He said authorities were anxious about strong winds that could help spreading the blaze further.
The loss of life due to a forest fire is the biggest in memory in Portugal. "So what we must do now is to calmly provide all the resources to fight the fires".
Portugal's team is in Russian Federation, where it is set to start the Confederations Cup later on Sunday against Mexico.
"The smoke cloud is very low, which does not allow helicopters and fire planes to work efficiently ... but we're doing everything possible and impossible to put out this fire", Gomes said, adding that no villages were now at risk.
Since noon on Saturday when the fire started in a mountainous area of the central Leiria district, measuring some 128 square kilometers, it has spilled over to another three municipalities: Castanheira de Per in Leiria, Figueiro dos Vinhos, and Gois.
At least 62 people have been killed in forest fires in central Portugal.
"We were afraid the fire would reach us", local resident Isabel Brandao told AP, adding that she feared for her life. "If it had rained, this would not happen".
It is not yet known what caused the fire, however Mr Costa said thunderstorms could have been one possible cause.
Temperatures in the Pedrogao Grande region have topped 40C in recent days, with a lightning strike and arid conditions being blamed for igniting the deadly blaze.
Other bodies were found in houses in isolated areas.
More than 100,000 hectares of the country's mainland was devastated by a series of fires past year.
- Top smartphones for gaming
- Two Australians confirmed dead in London Bridge terror attack
- US Open leaderboard crowded at the top
- Can Atleti snatch La Liga's title away from Barca?
- Congress seeks normalcy, heads back to work after shooting
- House Republicans warned of prospect for 2018 midterm losses
- Klitschko faces must-win bout against Fury
- US college student released by North Korea home, but in coma
- New York Times sues FBI to get notes of Comey-Trump talks
- Most active Western Conference teams this offseason