Police were also called to the scene after a stand-off broke out between 41 inmates and prison guards at HMP Grampian, in Peterhead, at about 8pm on Tuesday.
The incident started in a corridor in the prison's Ellon Hall and continued in the gated unit overnight.
Staff quickly sealed off the area after prisoners refused to go to their cells and started vandalising furniture.
Trained negotiators and riot teams were brought in from all over the country and the situation was finally brought to an end at 10.30am yesterday.
The Scottish Prison Service said no-one had been injured during the incident, but confirmed that parts of the wing had been damaged in an act of deliberate vandalism.
A prison spokesman said: "The incident at HMP Grampian has now been concluded following staff intervention.
"There's been some damage to cells and fixtures and fittings. We can't quantify yet how much.
"Obviously our first priority was getting the place secure.
"The behaviour shown by some of the prisoners was just wanton vandalism. We will work with colleagues and Police Scotland to try to bring to book those responsible."
Several ambulance crews were stationed outside the Aberdeenshire prison yesterday, along with emergency support vehicles.
Police officers were also standing outside the building, but were not believed to have been involved.
Specialist prison staff were eventually drafted in to help and the situation was brought under control.
The prison service said it was not yet clear why the incident happened.
The SPS spokesman said: "We train staff from all of our establishments for incident command teams to deal with incidents like this and we deployed teams from across Scotland to go and support the staff."