An enclosed play area for a teenage pupil with learning difficulties and autism, which was described as a "cage" by his MSP, has been removed.
The 18-year-old's parents raised funds for a safe play area at the Nicolson Institute in Stornoway, on Lewis.
However, SNP MSP Alasdair Allan said they were "deeply upset" to see what had been constructed.
Western Isles Council - Comhairle nan Eilean Siar - said it wanted to apologise unreservedly to the family.
Norman MacDonald, vice chairman of the policy and resources committee, said the enclosure was the result of a communication breakdown between staff and the supplier.
Mr Allan said the pupil's parents were full of praise for his teachers.
However, they had been unhappy that for the past five years he had spent almost six hours a day inside temporary accommodation with a teacher.
The parents raised funds to help cover the costs of a safe outdoor area, which they hoped would include decking and play equipment.
Mr Allan said: "Some months ago, the parents were deeply upset to see what had been constructed.
"It was what they describe as a small 'cage' sitting on the grass, constructed from old barriers and fencing of the type used on building sites.
"I believe that 'cage' is a reasonable description, and that this represents a failure on the part of the council to consider this young man's needs."
He added: "This is an incident which has caused very understandable offence to this family and raises questions about the provision in the Western Isles for children in a similar situation in future. I have raised this matter with the council by letter and await a response."
The enclosure was taken down over the past two weeks.
The Nicolson Institute is the largest school in the Western Isles, with about 1,000 pupils.
Senior councillor Mr MacDonald said an appropriate play area would now be built at the secondary.
He said: "I wish to apologise unreservedly on behalf of the council to the family of the boy involved.
"I think it is very clear to us and was very clear to the comhairle that the provision that was put in place was entirely inappropriate for the use to which it was going to be put."
Mr MacDonald said the specifications of what was needed had not been made clear to the supplier.