Emergency officials said another two people were hospitalized in critical condition with severe burns after the blast, which was reported around 8.30 a.m. (0630GMT) in the town of Kocevje.
The Melamin factory has about 200 employees. Company head Srecko Stefanic said the five missing people are likely buried under the rubble.
Stefanic said any bodies will be pulled out once the site cools down, possibly on Friday. The missing people “probably perished because the explosion was so strong there was no chance they survived,” said Stefanic.
The two people in critical condition were transferred to a hospital in the capital Ljubljana. A total of 20 people sought some kind of medical assistance, authorities said.
Stefanic said the blast occurred during the transfer of a highly combustible substance. It was probably the result of human error, he added.
The explosion sent black smoke billowing from the factory. Authorities, who initially asked people to stay indoors, later said preliminary tests showed no health threat.
Local residents said the explosion shook the entire area. The town, which is about 55 kilometers (30 miles) southeast of Ljubljana, has a population of about 8,000.
Emergency agencies reported the fire was put out by mid-morning. The factory building was badly damaged, they said.
Melamin produces chemical products including melamine resins for paper, construction, wood, rubber, and the lacquer industry, impregnated decorative paper for the furniture industry, and impregnated materials for footwear manufacturing.
The Slovenian Press Agency described the explosion as “the worst industrial fire in Slovenia’s recent history.” A total of 17 industrial fires have been recorded since 1995, resulting mostly in material damage, the agency reported.
By Ali Zerdin