The Dike Newell Elementary School in Bath was badly damaged in a late-night fire on Friday. Credit: Courtesy of the Maine Department of Public Safety

The man accused of starting a fire at a Bath elementary school reportedly confessed to police.

Allan Thomas Vigil, 30, of Bath has been charged with burglary and arson in connection with the Friday night blaze at Dike Newell Elementary School.

Vigil reportedly confessed to police that he broke into the school through a kitchen window on Friday night and spent more than 30 minutes roaming the halls before lighting paper on fire, according to The Times Record.

He also allegedly turned on the gas on the kitchen’s propane-powered stove, the newspaper reported.

Vigil left the school after the fire alarm went off.

The fire, which began in the school’s art storage room, caused extensive damage, and then reignited Monday, further damaging the structure and collapsing the roof of the two-story building.

Vigil made his first court appearance via videoconference on the burglary and arson charges Monday, and his bail was set at $75,000 with conditions that he remain under house arrest, not go near any school or possess incendiary devices, The Times Record reported.

Vigil will next appear in West Bath District Court on Aug 24. He remains at Two Bridges Regional Jail in Wiscasset.

This arson charge isn’t Vigil’s first. He was charged with arson in 2014, and received a suspended prison sentence and four years probation, according to The Times Record.