Man shot dead to stop 'frenzied' attack