A disturbance at the new HMP Grampian in Peterhead, which involved more than 40 inmates, has been resolved, the Scottish Prison Service has said.
The disturbance broke out at about 20:50 on Tuesday on Ellon wing, which houses short-term and remand prisoners.
Specially-trained staff wearing body armour entered the accommodation block at 10:30 on Wednesday.
All 41 occupants of the block involved were being dispersed to other jails. It is not known what led to the incident.
A considerable amount of damage was believed to have been caused to the prison.
There were 388 prisoners in the complex at the time.
HMP Grampian opened at the beginning of March as a replacement for HMP Peterhead and HMP Aberdeen.
Last month, prison officers wearing protective body armour were needed to break up trouble at the prison. No-one was injured.