MESA, Arizona (AP) — A gunman killed one person and wounded five others 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 suburban Phoenix.

The suspect was taken into custody after officers spotted him on an apartment balcony and deployed a stun gun. Numerous officers later led a handcuffed man to a truck parked outside an apartment complex. Police did not immediately release his identity.

The incident started with an argument inside a room at a motel and spilled outside, leaving three people wounded, Mesa Detective Esteban Flores said. The suspect then shot a person at a nearby restaurant and carjacked a gray Honda Accord. Two more people were wounded at separate apartment complexes, including one during a home invasion.

The shootings prompted an intense hunt for the suspect as Mesa police searched the trunks of cars, interviewed witnesses. Flores warned people in the neighborhood to remain indoors.

Several locations in the area were placed on lockdown amid a heavy law enforcement presence. The Arizona Department of Public Safety sent its special weapons and tactics team to Mesa to assist with the effort, DPS spokesman Bart Graves said.