The suspect, Kori Ali Muhammad was located by policemen after shooting three people dead.
Authorities have dismissed the act which occurred on Tuesday, April 18, 2017, as an act of terrorism.
The suspect reportedly launched the attack at different scenes.
Police chief, Jerry Dyer confirmed the killing and subsequent arrest of Muhammad who has increased tensions in a terrorism targeted United States of America.
Law enforcement officers were able to locate the suspect using ShotSpotter, a gunfire detection system that pin points the area where a shooting has occurred.
The suspect was reported to have fired 16 rounds of ammunition at different spots with a minute.
Muhammad had reportedly posted some anti-government comments on social before going on the rampage.