A Chilean judge on Saturday ordered the detention of a volunteer firefighter and a former forestry official for allegedly planning and causing a mammoth forest fire in the Valparaiso region.

The fire caused 137 deaths and made 16,000 people homeless in February.

The court in Valparaiso ruled the two men, who were arrested on Friday, could be held for 180 days while they are investigated.

Chief prosecutor Osvaldo Ossandon told journalists the main suspect is Francisco Mondaca, a 22-year-old volunteer firefighter in Valparaiso who is accused of physically starting the fire.

He said flares and fireworks were found in Mondaca’s vehicle.

The other suspect was identified as Franco Pinto, a former employee of the National Forest Corporation. He is accused of planning the crime.

The regional prosecutor for Valparaiso, Claudia Perivancich, said investigators have evidence the two men agreed “in advance to carry out conduct of this type when the weather conditions were adequate”.

Prosecutors said that according to Mondaca’s testimony, there was an economic motive behind the plot — providing more work in fighting fires. They said they had not ruled out the possibility of more people being involved.

The commander of the Valparaiso Fire Department, Vicente Maggiolo, said: “We are very dismayed by the situation”.

Mr Maggiolo called it an isolated incident and said it should not tarnish the work of the fire department.

“We have been saving lives for more than 170 years,” he told TVN.

Christian Little, executive director of the forestry department, described the detention of a former official as “a pain” for the agency.

Both the fire department and forestry agency said they would tighten hiring procedures.

The fire began on February 2 in the Lago Penuelas nature reserve in the central region of Chile. It burned for several days, including destroying more than 10,000 homes.

It is considered Chile’s worst tragedy since a magnitude 8.8 earthquake killed more than 500 people on February 27 2010.