Police almost killed as alleged offender pulls rifle and fires twice at close range.