Children at the school and a nearby nursery were told by police to stay indoors as a precaution.