The shepherd , seeing what had happened , ran up and caught him .