The sequence of events, per reports I've seen, is that the guy sneak-attacked the officer, the officer got off shots, and the attacker was shot and killed either by the officer he attacked and/or responding officers.
The attacker is Austin William Lanz of GA. He enlisted in the Marines in 2012 and washed out in a month or less. He has a criminal record in GA that includes burglary and assaulting a police officer.
At this point, my WAG is that the attacker is a mental case with a hatred for police and the military, probably a druggie, and possibly homeless/"transient".