Around 500 firefighters and 160 vehicles were dispatched to tackle the blaze, which broke out yesterday afternoon in the municipality of Pedrogao Grande before spreading.
"What we are seeing is a great tragedy. For the moment, 24 deaths are confirmed, but the number of fatalities could still rise," Prime Minister Antonio Costa said at the Civil Protection headquarters near Lisbon.
"The priority now is to get the ongoing fire under control -- after that we must understand what happened," he said.
"Three of them died from smoke inhalation and 16 burned to death in their cars when they found themselves trapped by flames on the road from Figueiro dos Vinhos to Castanheira de Pera," Gomes told journalists.
More From This Section
Fourteen civilians were injured, 10 of them seriously, along with six firefighters, he added.
The flames spread "with great violence", moving out on four fronts, he said.
Several villages were affected by the blaze but Gomes was not immediately able to comment on the extent of the damage caused.
Firefighters did "all they could" when faced with the blaze, he added.
Portugal was sweltering under a severe heatwave Saturday, with temperatures exceeding 40 degrees Celsius (104 degrees Fahrenheit) in several regions.
The country was hit by a series of fires last year which devastated more than 100,000 hectares (1,000 square kilometres) of the mainland.