A shark that came into shallow waters had to be pushed away before it came into contact with children.