Nearly 60 other people were injured, including four firefighters and a seriously injured minor, public broadcaster RTP reported, citing Interior Ministry official Jorge Gomes.
Portugal has declared three days of national mourning.
The fatalities occurred in the Pedrogao Grande area, about 150 kilometres (95 miles) northeast of Lisbon, where about 700 firefighters have been trying to put out the fires since Saturday, Gomes said.
Gomes said that at least 16 people were killed when their vehicles were engulfed by flames on a road between the towns of Figueiro dos Vinhos and Castanheira de Pera, and three others died from smoke inhalation in Figueiro dos Vinhos. No information was immediately given on how the others were killed.
A huge wall of thick smoke and bright red flames towered over the top of trees near houses in the wooded region.
Local resident Isabel Brandao told The Associated Press that she had feared for her life.
“Yesterday we saw the fire but thought it was very far. I never thought it would come to this side,” she said. “At 3:30am, my mother-in-law woke me up quickly and we never went to sleep again. We were afraid the fire would reach us.”
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 metres (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.
Costa said that while investigations are ongoing to determine the cause of the fire, authorities believe that the high temperatures of 40 C (104 F) in recent days may have played a part.
“This is a region that has had fires because of its forests, but we cannot remember a tragedy of these proportions,” said Valdemar Alves, mayor of Pedrogao Grande. “I am completely stunned by the number of deaths.”
Portugal, like most southern European countries, is prone to forest fires in the dry summer months.