MESA, Ariz. - A gunman killed one person and wounded five Wednesday in a rampage that included a motel shooting, a carjacking, and a home invasion and ended with his arrest at a nearby apartment in a Phoenix suburb.

The suspect was taken into custody after officers spotted him on an apartment balcony and shot him with a stun gun.

Police identified the man as Ryan Giroux, 41, who has served three stints in state prison since 1994. A mug shot from the state Department of Corrections shows him with several face and neck tattoos, including the word skinhead where his eyebrows would be.

He served prison terms totaling more than eight years for burglary, theft, attempted aggravated assault, and a marijuana violation, the Corrections Department said. He was released from prison most recently in late 2013.

Wednesday's rampage started with a dispute inside a room at a motel and spilled outside, leaving one man dead and two women wounded, Mesa Police Detective Esteban Flores said.

The gunman then shot a man working at a nearby restaurant. That victim, an adult student at nearby East Valley Institute of Technology, was able to run across the street to responders already at the motel, Flores said. The school said in a statement that he was one of seven students and an instructor working at Bistro 13 restaurant. The student was treated at a hospital and released.

The gunman got away by carjacking the instructor's car.

Police say the man then went to an apartment complex about two miles away, where he entered an apartment and shot a man. That victim will survive, police said.

A police officer spotted a man in a neighboring apartment building with multiple gunshot wounds, Flores said. He was listed in critical condition.

Vinny Carbone owns an auto shop near the motel and restaurant. He was getting ready to open when he heard a man yell "Help, help" from Bistro 13. He turned and saw a woman outside the motel with what looked like a bullet hole in her side.