A small cottage perilously close to the edge at Stonewall Beach in Chilmark has been demolished to prevent it from falling over the cliff, town building inspector Leonard Jason Jr. said Tuesday.

The demolition of the structure, which contains a bedroom, began Monday, Mr. Jason said. By Tuesday afternoon the demolition on Greenhouse Lane was complete. The debris was trucked off to the Edgartown landfill.

The teardown marks the first time in memory that a house in Chilmark was taken down due to the threat of erosion. The structure is owned by longtime Chilmark resident Natalie Conroy, who also owns a small summer home on the property. Mrs. Conroy has not applied for a demolition permit for the house and is still able to live in it for the summer season, Mr. Jason said. The house stands six or seven feet from the edge and rests on a system of piers.

The home has inched closer to the edge in recent years due to severe erosion and heavy wave action that has washed away large swaths of the south-facing shoreline. Mrs. Conroy moved the main house back 26 feet with town approval in 2011. The conservation commission ruled in February that the structures could not be moved again and instead had to come down.