More than 200,000 gallons of toxic water leaked from a dam at a Massachusetts lake and is now at the center of a massive chemical spill investigation, state officials said Thursday.

The spill was discovered Thursday afternoon and is being investigated by the Department of Environmental Protection and the state Department of Public Health and the Massachusetts Department of Conservation and Recreation.

The agency will conduct an emergency water testing program to determine if the spill could have been caused by a water treatment plant that was operating illegally.

A toxicology test will be conducted Friday and it could take several weeks to confirm the source of the spill, said spokesman Jeff Leach.

The toxic water was stored at a state-owned dam, Leach said.

The dam at the base of the Thirumala Dam in south-central Massachusetts, about 1,100 miles northwest of Boston, was used to treat water from the nearby Kewaunee River.

Officials say the state is investigating the source and whether any contamination is related to the dam’s operations.

The spill occurred Thursday evening at the south-facing dam.

The river’s flow is typically about 100 to 200 feet per second, said state aquatic resources spokeswoman Jennifer Smith.

The flow was reported about 3:30 p.m. on the north side of the dam.

Leach said the spill was contained by about 8:30 a.m., but it could have spread to the surrounding areas.

Water and chemicals are not yet released into the river, which flows northward through the forested area and is home to an endangered woodpecker, she said.

Water from the dam had to be treated to contain the spill and was being pumped to the city of Worcester.

The water is expected to be pumped out of the area Friday.

As of Thursday evening, no injuries or property damage had been reported, according to a state report.

A Massachusetts Department for Environmental Protection spokesman said it is investigating whether the water was contaminated with the toxic chemical hydroxyl chloride.

Hydroxyl chlorine is a mixture of hydrogen cyanide and sulfuric acid, and is used to remove toxic metals from water.

The state is asking residents in the area to remain indoors until further notice, and officials are asking anyone who may have seen or smelled the chemical to contact the DDEP immediately.

The area is about 10 miles (16 kilometers) from Thirumpet Dam, which is owned by the city.

The city also owns the nearby Thirupala Dam, where the water is used for treatment.