A JCB knocked down about 20m of the wall in Falkland
Campaigners in a Fife village are celebrating after developers were ordered by the council to stop building work close to a historic wall.
A section of the 250-year-old Falkland wall had been demolished by Lomond Homes who were developing the surrounding land.
The order means the company has been asked to repair the sandstone wall and leave the site.
Locals said it was a "comprehensive victory".
Councillor David MacDiarmid, whose Howe of Fife ward covers Falkland, said: "We have managed to save what is left of the wall, for another 300 years, with hopefully a view to getting a repair order placed on it.
"There is now a temporary stop notice and the developer has been asked to leave and the wall is under the control of Fife Council.
"It has been a long haul, but I am very happy."
One of the campaigners, Stuart Haszeldine said: "We have succeeded in a comprehensive and unique victory.
"This was a big team effort, the campaign group discovered an existing law - The Planning (Listed Buildings and Conservation Areas) Scotland Act 1997, which states that if structures are an important part of a conservation area - then the local authority can apply for powers to preserve them.
"We presented this to the council and they have placed a stop order on the building work.
Mr Haszeldine added: "We believe this is the first time this has been done - it gives real power to local authorities and local communities who want to look after their conservation areas.
"We also want to thank Historic Scotland for their help and advice in this matter."
A spokeswoman for Historic Scotland said: "Given the important contribution the wall makes to the conservation area, we have worked closely with Fife Council to support its efforts to secure the retention of the wall.
The wall in Falkland had been standing for about 250 years
"We understand that Fife Council has now served a temporary stop notice and we will continue to provide advice as the situation develops."
A spokesman from Lomond Homes said: "We demolished the first section of the wall in order to comply with a notice issued by Fife Council requiring, by law, that work be undertaken to remove the danger of it collapsing.
"I can confirm that we have now received a Temporary Stop Notice and, as with the last notice, we will of course comply."
Lomond Homes had applied to make the wall on Falkland's Pleasance safe before creating an access road close to the wall.
Councillors thought they had an agreement with Lomond Homes to only take off the top metre of the wall.
However, Lomond Homes said the wall could not be made safe and that a report by structural engineers had said the wall should be knocked down for health and safety reasons.
But councillors and locals were "absolutely livid" when they discovered that a 65ft (20m) section had been knocked down.