Dungavel became a byword for some of the most frightening aspects of seeking asylum in the UK, refugee groups said as the controversial facility's closure was finally announced.

Another name was "Scotland's shame".

Those who were detained there said it had been built to be a prison “and that is what it was".

Many were taken there during one of the notorious "dawn raids" which prompted a public outcry and furious demonstrations, including by the "Glasgow Girls", a group of pupils from Drumchapel High School angry at the heavy-handed way school their friend had been removed.

Detainees described being transported in vans like criminals to Dungavel, being given ID numbers that had to carried at all times and a regime of constant monitoring by security guards.

Teenagers told of being allowed outside for only one hour each day, their movements within the building restricted in its warren of corridors, which could be sealed off by staff.

Dungavel was described as especially frightening for children.

Its role in detaining the families of failed asylum seekers brought widespread condemnation.

The plight of the Ay family, first raised by The Herald, highlighted the suffering of families caught in the system.

Like most at Dungavel, the Ay family were detained while awaiting a decision over their appeal against deportation.

Yurdigal Ay and her four children, aged between eight and 14, spent more than a year at the centre while outside church leaders, politicians and children's charities condemned their incarceration, arguing it breached international children's rights laws.

They were deported to Germany and later granted asylum following psychiatric reports into the emotional health of two of the family’s daughters as a result of their time in Dungavel.

For more than a decade the immigration centre was the scene of protests by campaigners angry at the government's detention of asylum seekers and their families.

Now the former open prison near Strathaven, once a summer retreat for the Dukes of Hamilton, will finally lose its reputation as the place that "shamed the country".