Dun Laoghaire-Rathdown Council have secured an injunction in the High Court which should prevent further occupation of the Carrickmines Castle site in South Dublin.
The order was made by Mr Justice Paul Gilligan, who ordered that the injunction be posted on all entrances to the site and every 100 yards on the perimeter wall.
It is expected that the Council will remove the castle's perimeter wall in the coming days, an operation which should take less than a week.
The Court heard that delays in carrying out this work and handing the site over to contractors Ascon could result in the Council having to pay between €50,000 and €100,000 a week in penalties.
The Council declined to comment on either today's order or a statement by protestors that the fight to protect the entire castle would continue.
Earlier this afternoon the two occupiers of the site, Vincent Salafia and Gordon Lucas, gave an undertaking that they would leave the site immediately.
Speaking after the initial hearing, Salafia said that while he was leaving Carrickmines Castle today it was not the end of the protest and efforts would continue to save the site.