OGUNQUIT — The Maine Fire Marshal’s Office says a fire that destroyed a waterfront hotel and restaurant in Ogunquit started accidentally, probably due to an electrical malfunction.

Both the Blue Water Inn and Huckleberry’s Restaurant were total losses after a blaze started in the hotel and spread to the restaurant Tuesday night. The Fire Marshal’s office said Friday that the fire started within a wall of the hotel that held the electrical entrance panels.

Authorities say the fire burned inside the wall before breaking out, extending to the rest of the seven-room bed and breakfast and into the second floor of the restaurant.