AURORA, Colo. – Sunday was a prayerful day of official and unofficial mourning in this shattered community. President Obama flew into town to console the families of those slain and wounded, thousands of residents gathered for an evening memorial service, and hundreds more huddled in the rain for a prayer vigil across the street from the site of Friday’s shooting rampage.

It now appears that the casualties could have been even more horrific. The gunman’s semiautomatic assault rifle jammed and prevented him from emptying a 100-round magazine of ammunition, according to a law enforcement source.

There also emerged a new twist in the narrative that indicates that the alleged shooter, identified by authorities as James Holmes, 24, did not immediately surrender to police and could have come close to eluding capture by slipping away in the guise of a SWAT team officer.

Holmes was not cooperating with officials as he was being held in solitary confinement at a Denver-area county detention facility, Aurora Police Chief Dan Oates told The Associated Press.

“He lawyered up. He’s not talking to us,” the chief said. It could be months before they learn the motive behind the shootings that left 12 dead and 58 injured, with authorities working with FBI behavioral analysts and looking into Holmes’ relationships.

Police have said that Holmes began buying guns at Denver-area stores nearly two months before Friday’s shooting and that he received at least 50 packages in four months at his home and at school. Also on Sunday, a gun range owner east of Denver said he recently rejected a membership application from Holmes in part because of a bizarre voice mail greeting on Holmes’ phone.

Holmes, being held without bond at the Arapahoe County Jail, will appear in court for the first time today.

“Aurora is strong,” said one handwritten sign at a makeshift memorial site marked with 12 white crosses near the Century 16 movie complex, where the gunman burst into a midnight screening of the new Batman movie, “The Dark Knight Rises.”

Sunday evening, thousands of people filled a plaza in front of Aurora’s city hall for the memorial vigil. The event blended familiar rituals of mass grief — American flags waved, and mourners laid flowers and lighted candles — with symbols of the young fan community that had gathered in the theater that night. One man held up a sign that combined the Batman bat silhouette with the “C” on Colorado’s flag. A woman paired the bat with a bright-red heart. “Hope Lives,” that sign said. Police officers watched from the rooftops.

Obama flew from Washington on Sunday afternoon and went to the University of Colorado Hospital in Aurora to meet with the families of victims. Ten of the victims are still being treated in the hospital, with seven listed in critical condition.

“Sat down with President Obama. He has been incredible. He too has agreed not to mention the shooter’s name,” tweeted Jordan Ghawi, brother of Jessica Ghawi, an aspiring sports reporter killed in the attack.

This is a swing state in the presidential election, but the candidates have pulled down their television ads. Obama chose not to attend the large memorial service later in the evening; he flew on to the West Coast.

Nor has he tried to use the mass shooting to call for any new gun-control laws. Press secretary Jay Carney told reporters on Air Force One during the flight to Colorado, “The president’s view is that we can take steps to keep guns out of the hands of people who should not have them under existing law.”

A law enforcement source, who is close to the investigation but not authorized to speak publicly, said something went awry in the killer’s planned assault at the theater. Police said the alleged gunman had three weapons: a Remington shotgun, a Smith & Wesson M&P assault rifle and a Glock .40-caliber handgun.

The semiautomatic assault rifle, which is akin to an AR-15 and is a civilian version of the military’s M-16, could fire 50 to 60 rounds per minute and is designed to hold large ammunition magazines. The source said that Holmes allegedly had obtained a 100-round drum magazine that attached to the weapon but that such large magazines are notorious for jamming.

The law enforcement official said authorities believe the gunman first used the shotgun — some victims in the hospital have buckshot wounds — and then began using the assault rifle, which jammed. Then he resorted to the handgun.

Oates, the police chief, interviewed on “Fox News Sunday,” did not confirm or deny that the gun jammed but said police found the 100-round magazine lying on the theater floor. He said he did not know whether it was empty.

Initial police accounts said Holmes surrendered without incident to police who found him at his car behind the theater complex. But Oates, in an interview on CBS’s “Face the Nation” on Sunday, described a more complicated scene in the minutes after the shooting. He said officers arriving at the scene might have mistaken Holmes for a SWAT officer. He was allegedly dressed in black ballistic gear, including a helmet, throat guard, vest, leggings and gloves.

Oates said a piece of equipment in Holmes’s elaborate gear — he would not specify which piece — struck one of the responding officers as irregular. The officer questioned Holmes. Oates did not describe the exchange, only the result: Holmes was arrested.

Police, meanwhile, are trying to restore some sense of normalcy to the neighborhood where Holmes lived and where residents of five buildings had been evacuated after police discovered that the suspect’s apartment had been booby-trapped.

After clearing the apartment of dozens of explosives Saturday, bomb squad officers on Sunday transported hazardous chemicals to a nearby field and burned or destroyed the material.

Glenn Rotkovich, owner of the Lead Valley Range in Byers, Colo., said Holmes emailed a request for an application to join. When Rotkovich called Holmes, he said, he got an answering machine with a “bizarre,” guttural, unintelligible recorded greeting. He told his staff that if Holmes showed up he should not be allowed to fire weapons until Rotkovich checked him out.