HOUSTON — Refinery operators and power company officials are trying to piece together why several Texas City plants lost power unexpectedly, leading to shelter-in-place warnings, Tuesday school cancellations and plant flares that lit the skies over the coastal town.

The brief outages, which happened in two clusters starting around 9:30 p.m. Monday and 4:30 a.m. Tuesday, prompted BP, Valero and Marathon Oil to shut down their refining operations. Dow Chemical also shut down equipment at its Texas City chemical plant, which makes components used in consumer and industrial products.

Flare towers designed to burn off emissions glowed late Monday and in the predawn darkness Tuesday at BP's sprawling refinery and chemical complex. A fire broke out in one unit shortly after the facility lost power, but it was quickly put out.

Dow Chemical said it had no emissions after its shutdown and did not need to flare, while Valero said it flared only early Tuesday morning.

Texas City officials warned residents to stay inside beginning late Monday to avoid exposure to possible emissions. Texas City schools closed for the day, and La Marque's opened late.

Residents reported hearing explosions that sounded like transformers blowing out before the outages Monday night.

A Texas Commission on Environmental Quality investigator arrived in Texas City at 8 a.m. Tuesday and measured emissions with a handheld device at seven locations. The measurements for volatile organic compounds — a broad class of chemicals found in crude oil, pesticides and common solvents such as turpentine — exceeded the instrument's capability, said Terry Clawson, an agency spokesman.

“Based upon our monitoring values, we believe that the city manager's decision to issue a shelter in place was appropriate,” Clawson said, adding that the decision to later lift the shelter in place was based on all available monitoring data. The facilities that reported outages must report any emissions to TCEQ within 24 hours.

By Tuesday evening, only Valero's data showed up on a TCEQ database, reporting release of an estimated 43,000 pounds of sulfur dioxide from emergency and startup flaring. Sulfur dioxide can react with other compounds to form ultrafine particles, which are associated with heart and lung disease.

Tuesday afternoon, Valero, Marathon and Dow said power was restored, and they were restarting operations as equipment was operating properly.

BP said its 473,000-barrel-per-day refinery had only limited power by Tuesday afternoon, however, and that it has not restarted most processes.

BP's Texas City refinery has on-site power generation capacity and generates more electricity than it uses. The three other facilities rely on power from the local grid, which is owned and operated by Texas New Mexico Power Co.

The outages Monday night appeared to be due to failures of equipment owned and operated by the refiners, according to TNMP spokeswoman Cathy Garber, while the ones Tuesday morning occurred when a buildup of soot, dust, salt and other residues on transformers and insulators caused equipment to short-circuit.