Around 500 firefighters and 160 vehicles were dispatched to tackle the blaze, which broke out in the 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.
Secretary of State for the Interior Jorge Gomes earlier said all 19 of the people then confirmed dead were civilians.
"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.
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.
President Marcelo Rebelo went to the Leiria region to meet families of the victims, "sharing their pain in the name of all the Portuguese people," he said.
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
Fires on the tourist island of Madeira in August killed three people, while over the course of 2016 around 40 homes were destroyed and 5,400 hectares of land burned.