MONROEVILLE, Pa. -- A teenager who police say opened fire at a Pittsburgh-area mall, shooting his intended target as well as two bystanders, was arrested early Sunday, and the three victims remain hospitalized.

Gunfire erupted inside the Macy's department store at the Monroeville Mall about 7:30 p.m. Saturday, sending panicked shoppers running. The gunman fled but police say they were able to identify him by matching surveillance video with images on social media. A preliminary hearing was scheduled for Feb. 18, according to court documents.

Tarod Thornhill, 17, was arrested at a home in Brackenridge about 3:15 a.m. Sunday. He was being held at the Allegheny County Jail pending arraignment on charges as an adult of aggravated assault, attempted homicide and recklessly endangering other people.

Police Chief Douglas Cole said two men and a woman were shot, including the man who was targeted. Cole said the two men were in critical condition, while the woman was in stable condition.

"This was not random," Cole told reporters. "We have evidence that leads to that." He declined to elaborate.

A 20-year-old man and 53-year-old man were both in critical condition, and a 47-year-old woman was in fair condition Sunday afternoon, Forbes Hospital spokesman Jesse Miller said.

In late December, hundreds of teenagers gathered at the mall and several fights broke out. The fights caused local officials and mall administration to agree on a plan to increase security there.

Shoppers described chaos as shots rang out.

"All of the sudden we heard people screaming," Athena Coffey of Churchill told KDKA-TV, "and the next thing you see is a bunch of people, teenagers, scared to death, just exodus en masse in a way you could not believe. I grabbed my children, husband, we started screaming 'go, go, go!"'

Yvette Jackson of North Braddock was attending a birthday party at Giggles andSmiles, a fitness and fun centre for children.

"We saw a lot of running, a lot of chaos," she told the Pittsburgh-Tribune Review. She said she and other patrons were locked in the store for about 45 minutes until police came and let them out.

Four on-duty police officers have been stationed in the mall on Friday and Saturday evenings at the mall's request, Monroeville Mayor Gregory Erosenko said.

"I would have thought that having four officers there would have deterred any incident like we saw (Saturday)," he told the newspaper.

Weapons are banned at the mall except for those carried by on-duty law enforcement officers.

The mall, which is owned and managed by CBL & Associates Properties Inc., of Chattanooga, Tennessee, says on its website it features more than 125 stores and eateries, anchored by JCPenney, Macy's and Barnes & Noble.

No one answered the phone at CBL offices after business hours Saturday. A mall security officer reached by telephone said he couldn't talk.