A prison riot was brought under control on Saturday night after a specialist national response squad was called in to halt the disturbance.

Inmates at Maidstone prison in Kent ran amok and smashed up one wing used mainly to house foreign nationals nearing the end of their sentences.

The prison officers' union said about 180 people housed on Thanet wing had taken part in the unrest, which started at about 4pm, and prison staff were forced to retreat to safety in other parts of the complex.

A Prison Service spokesperson said the incident involved just 40 inmates and was resolved after less than three hours with no injuries to staff or prisoners. "An investigation is under way and the perpetrators will be dealt with appropriately by the prison," the spokesperson added.

Officers from special prison service riot units across the country were drafted in to deal with the incident in a system known as Operation Tornado. Maidstone, which has an inmate population of about 600, is a category C training prison that mainly houses sex offenders from the Kent and Sussex areas. However, it also holds 180 foreign inmates.

Its website says it aims to "create a therapeutic environment that supports, embraces and empowers change with a primary focus on risk reduction and protection".

Category C prisons are for inmates who cannot be trusted in open conditions but who are unlikely to try to escape. It is one of the oldest penal institutions in the country, having been in operation for almost 200 years.