A gunman clad in black SWAT gear came through an emergency door at a movie theater in Colorado early Friday, hurled two canisters of an unknown gas and opened fire on the stunned audience, killing at least 12 people and wounding 59 others who were watching the midnight premiere of a new Batman film.

Police identified the suspected gunman as 24-year-old James Eagan Holmes, a graduate student at the University of Colorado who was in the process of withdrawing from his academic program.

Officers arrived at the theater in the Denver suburb of Aurora within 90 seconds of receiving the first 911 call at 12:39 a.m., and almost immediately arrested Holmes, who was next to his white Hyundai outside a rear entrance to the theater, police said.

Authorities recovered two Glock pistols, a Remington 12-gauge shotgun and a Smith & Wesson AR-15 assault rifle. Aurora Police Chief Dan Oates said there was “pretty significant evidence” that the shotgun, the assault rifle and at least one of the pistols were used in the attack. He said he did not know what the “legal status” of the weapons was, a matter he said is under investigation.

Federal law enforcement sources said later the gunman bought all four guns legally over the last two months from the local branches of two national chains: Gander Mountain Guns and Bass Pro Shop.

Investigators believe the shooter acted alone and not as part of a terrorist group.

“We are not looking for any other suspects,” Oates told reporters. “We are confident that he acted alone, but we will do a thorough investigation to make sure that is the case.”

Witnesses told police the gunman fired a handgun in the air, then began shooting at adults and children in the darkened theater — many of whom initially thought his entrance was a promotional gimmick for the movie, “The Dark Knight Rises.”

The gunman looked calm and said nothing as he walked up an aisle, firing as he went, witnesses said. As shrieking movie-goers realized the attack was real, they dove to the floor or scrambled to flee the Century 16 theater.

“There were many, many shots fired,” Oates said at a midday news conference. “There are many critical patients, and I am not in any position to give you updates on the 59 who were injured.”

The bodies of 10 victims remained at the theater more than 12 hours later, Oates said, along with numerous shell casings. Oates said police are trying their best to remove the bodies, identify them and notify next of kin as soon as possible.

The gunman “was aiming anywhere,” survivor Chris Ramos told CNN. “He was not aiming for a specific person. He was aiming for everyone.” Ramos said he believes the man in the seat next to him, the father of two daughters, was killed.

Oates said the assailant was dressed all in black, wearing a “ballistic helmet,” a bulletproof vest, leggings, a throat protector, a groin protector, a gas mask and protective gloves. He declined to speculate on a motive for the massacre or say whether Holmes was answering questions from police.

Law enforcement sources said the shooter’s hair was died orange-red, like the Joker character in the Batman movies. When he was arrested, he was wearing all of his black gear.

The Pentagon said three military personnel were injured in the shooting and that another service member at the theater remained unaccounted for.

Two of the injured are members of the Air Force, while the third serves in the Navy, the Defense Department announced Friday afternoon. The unaccounted-for service member is also a sailor. The Pentagon did not identify any of the individuals or their units, or provide details of their medical condition.

The department said Holmes “is not a past or current member of any branch or component of the U.S. Armed Forces.”

Among those killed was Jessica Ghawi, according to her brother, Jordan Ghawi. She was an aspiring sports journalist who had recently survived another shooting at a mall in Toronto. Ghawi was the first confirmed fatality in the Colorado shootings. She had tweeted from the theater shortly before the rampage that she was excited to see the movie.

Salina Jordan was in the next theater, also watching “The Dark Knight Rises,’’ when she heard a series of pops. “It was so in synch we thought it was part of the movie,’’ said Jordan, 19. “We thought it was a special effect because they were trying to do it up big for opening night.’’

Then bullets began piercing the wall of the second theater. A teenager to Jordan’s right was shot in the jaw. The fire alarm went off.

In the lobby, by the concession stands, SWAT teams trained their guns at Theater 9. They directed frightened patrons to remain in place — or run for the exits — as gunfire started and stopped. Jordan said she watched a police officer carry out the inert body of a little girl, who appeared to be about 9.

“She had been shot through her stomach, and the blood was just coming out,” Jordan said. “Her body was so limp. And her face, there was no life in her face.’’

Police converged on Holmes’s apartment, in a modest neighborhood about five miles from the theater, at about 2 a.m., after Holmes indicated it contained explosives .

Oates initially told reporters that the apartment, No. 10, appeared to be rigged with “pretty sophisticated” explosives. But he said later, at the news conference, that bomb technicians were trying to determine whether the maze of wires and incendiary materials they found at the apartment were a hoax or posed a real danger.

“Everything was linked together with all sorts of wires,” Oates said. Five buildings were evacuated.

Holmes, who will have a preliminary court appearance on Monday, had no previous contact with the Aurora police department, save for a traffic summons for speeding in 2011, Oates said.

Holmes was “very quiet, strangely quiet in class,” and he seemed “socially off,” the faculty member said.

When the staff member heard Holmes’s name in connection with the shooting, he thought that it could well be his student, and he was not surprised to find out later that it was.

When Holmes and other neuroscience students took their comprehensive exams last semester, Holmes did very poorly, he said, and the school’s staff contemplated putting him on academic probation.

The shooting horrified the nation and immediately drew the attention of President Obama and former Massachusetts governor Mitt Romney, his GOP rival in the 2012 election. Both Obama and Romney expressed condolences, canceled planned campaign events and suspended campaign advertising in Colorado.

Noting that his two young daughters like to go to the movies, just like millions of other Americans, Obama said he and first lady Michelle Obama would “hug our girls tighter tonight.”

The shooting is a “reminder that life is fragile,” Obama said. “Our time here is limited, and it is precious.”

Jennifer Seeger, 22, was sitting in the second row of the theater when the gunman burst in. He pointed a rifle at her face. She dove into the aisle and tucked herself under a chair, and the gunman shot a person behind her.

“He was literally massacring everyone who ran away,” Seeger told CNN.

Police initially said 14 people were killed in the attack, which began about a half-hour into the movie. But they later revised that number to 12 — 10 of whom died at the theater. Two others were rushed to a hospital but succumbed to their wounds.

Others remain hospitalized in critical condition, and police warned that the death toll could increase. Victims ranged from young children to adults, and they were taken to six different area hospitals, police said. Many were driven to hospitals in police cars, after officers decided not to wait for more ambulances to arrive.

“This is not only an act of extreme violence, it is also an act of depravity,” Colorado Gov. John Hickenlooper (D), a former Denver mayor, said. “It is beyond the power of words to fully express our sorrow this morning.”

In San Diego, a woman who was contacted by ABC News told reporters she was Holmes’s mother. She said had awoken unaware of the shooting and had not yet been contacted by authorities, but immediately expressed concern to ABC that her son may have been involved.

“You have the right person,” she said. “I need to call the police.... I need to fly out to Colorado.”

The apartment building where Holmes lived was affiliated with the University of Colorado-Denver’s Anschutz Medical Campus, residents said. The burgeoning campus includes a medical school, a trauma center and a children’s hospital. It is the same complex where many of victims of the mass shooting were taken for treatment.

University officials said Holmes enrolled in the graduate program on the medical campus just over a year ago.

A neighbor of Holmes’s said she and other residents were woken by police at 2 a.m. and told to get dressed and evacuate immediately. The police did not explain the reason or mention the mass shooting, but asked whether residents of the small apartment building had heard any noises coming from apartment No. 10.