Armando Hernandez, Jr. was detained after he was confronted by officers Wednesday night in the suburb of Glendale, police said on Twitter. No information was disclosed about a possible motive or specific charges, and it was not immediately known if the suspect had a lawyer who could speak on his behalf. Authorities planned to hold a news briefing Thursday.
One of the victims was in critical condition and two others suffered non life-threatening injuries, police said earlier.
The shooting happened at about 7:25 p.m. in Glendale's Westgate Entertainment District, where people had headed to stores and restaurants that recently reopened after they were closed for more than a month because of the coronavirus pandemic.
State Sen. Martin Quezada, a Democrat, wrote on Twitter that he witnessed a person "with an AR-15 shoot up Westgate."
A Glendale Police Department spokeswoman, Officer Tiffany Ngalula, said she could not confirm whether an AR-15 semi-automatic rifle was used in the shooting.
"I saw 2 victims with my own eyes. Not sure how many others," Quezada wrote on Twitter. "I saw the shooter. Being told not to say anything else about details 'til I speak to police. I'm ok. Lots of shaken up people."
Video posted on social media showed people running from the area and scenes of people embracing each other after being reunited.
Eliana Rivera, a sales associate at a pottery painting store, posted on Twitter that she and a co-worker heard police running and helicopters overhead as they huddled in the back of the business, the Arizona Republic reported.
"It's just unreal," Rivera said. "You see it on the news. It happens and you never really think that you would be put in that position. You just think, 'What are the chances that that will happen?' - and it did."
A woman who was picking up food from a restaurant said she heard loud shots and then people ran by as she got into her car, which a man tried to enter to flee the area.
"It was like a feeling of wrong place, wrong time," Aja Sanders told the Republic.
Ngalula, the Police Department spokeswoman, said the shooting had stopped by the time officers arrived.
"We were able to locate that suspect in the Westgate area, our officers challenged that suspect and were able to safely take that person into custody," she said.
Police were still searching the area for evidence Thursday morning and a tow truck hauled away a white car about 4 a.m.
The area includes a stadium for the NFL's Arizona Cardinals and hockey arena for the NHL's Arizona Coyotes.