'Heroic' officer stops shooting