The death toll released by Jorge Gomes, the secretary of state for internal affairs, has gradually climbed from the 19 initially announced late on Saturday. Gomes said most of the victims were caught in their vehicles on the road.
Another 59 people have been injured and taken to hospitals, including five in serious condition.
The blaze on Saturday hit the mountainous area of Pedrogao Grande, 200 km northeast of Lisbon, amid an intense heat wave and rainless thunderstorms. Police said a lightning striking a tree probably caused the fire.
Hundreds of firefighters were still battling the flames on Sunday morning. Various local motorways were shut for safety reasons.
"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 currently at risk.
President Marcelo Rebelo de Sousa visited the site of the tragedy during the night and later expressed his condolences.
The "situation is unfortunately atypical ... " he said. "It was not possible to do more than what has been done" in prevention and the immediate response.
Television footage showed hundreds of local residents being treated for smoke intoxication in emergency services tents set up in the area. Many who lost their homes were transferred to temporary shelters.
RTP showed terrifying images of several people on a road trying to escape the intense smoke that had reduced visibility to a question of a few meters (yards). A young man shared a bottle of water with a distraught woman as she stumbled down the road.
Costa said that firefighting crews were having difficulties in approaching the area because the fire was “very intense.” He added that Portuguese authorities were working on identifying the victims and that Spanish rescuers would assist in efforts to control the blazes.