Discipline problems are going unchecked in some schools because head teachers refuse to exclude persistently disruptive pupils, a union has claimed.
The Scottish Secondary Teachers' Association welcomed a fall in exclusions but highlighted "you shall not exclude" orders in some schools.
There were 26,844 exclusions in the past academic year, an 11% fall.
A head teachers union said its members were dealing with complex problems within the available resources.
SSTA general secretary Ann Ballinger welcomed the use of alternative methods of support for "troubled young people".
But she added: "Senior managers in a small number of schools across Scotland are refusing to deal with pupils whose indiscipline is both detrimental to learning and spreading fear and alarm throughout the school community.
"Fortunately these cases are relatively rare but this is of no comfort to pupils and staff terrorised in the workplace.
"Head teachers who refuse to exclude where exclusion is the appropriate action, are simply putting at risk the education of the well-behaved majority of pupils."
The School Leaders Scotland union, which represents head teachers, said its members did what they could with the resources available to them.
But it said the process of exclusion and placing pupils in other institutions could be complex and expensive.
Education Secretary Mike Russell told BBC Radio Scotland's Good Morning Scotland programme: "I accept that some schools don't want to exclude young people because they don't think it's good for them.
"But I think they all know that sometimes, very occasionally, that has to happen.
"I have no evidence that in circumstances where it has to happen, it doesn't happen."