AURORA, Colo. — Killing a dozen people and wounding more than 50 others was apparently not enough. A sophisticated series of explosive booby traps in an otherwise ordinary apartment had been set to detonate whenever anyone came into the apartment, devices so intricate that the police struggled to disarm them.


James Eagan Holmes, the suspect who the police say brought terror to this Colorado community, had been a shy, awkward boy who once seemed quietly bound for big things. He was a science student from Southern California who won scholarships and internships, graduated “at the top of the top” from the University of California-Riverside and moved to Colorado last year to take the next step: a doctoral program in neuroscience.


But Mr. Holmes struggled through his first academic year at the University of Colorado-Denver, and had dropped out by this spring. Neighbors from his gang-ridden neighborhood in Aurora described him as a solitary figure, always alone as he bought beer and liquor at neighborhood shops, ate burritos or rode his bicycle through the streets.


He appears to have created an online personal ad on the Web site Adult Friend Finder, posting a photo of himself with bright orange hair and saying that he was “looking for a fling.” He described himself as a nice guy, or as nice as any man “who does these sorts of shenanigans,” though the authenticity of the profile could not be independently verified.


Some nights, neighbors heard loud music throbbing in his third-floor apartment, and often complained about it, or noticed a strange, purple light in the windows. Sometimes, the windows were masked by newspaper, as if he wanted no one to see inside.


On Saturday, the police went about the delicate task of clearing the dozens of booby traps and improvised explosives in the apartment.


“It was set up to kill,” said Sgt. Cassidee Carlson of the Aurora Police Department. “This is some serious stuff that our team is dealing with.”


With each controlled detonation, a low thud could be heard from across the street, where dozens of television cameras remained pointed up at the third floor window, its glass smashed out and busted blinds blowing in the breeze.


There was fear that as officers tried to disable the devices in the apartment, they might create a secondary explosion, damaging valuable evidence that might be inside the apartment. But the operation was initially successful, with no major explosions or fires.


By the afternoon, law enforcement officials said that many of the main threats had been eliminated.


Mr. Holmes’s background was science. Before dropping out he took a class that explored the biological origins of psychiatric and neurological disorders, and was scheduled to give a presentation on “MicroRNA Biomarkers,” according to a class schedule published online. The topic appears to demonstrate an interest in the genetic basis of mental illness.


The field of micro-RNA research is relatively new, and scientists still know little about how the short snippets of genetic material that can turn off or potentially turn up the action of a gene might play a role in illnesses like bipolar disorder or schizophrenia, said Dr. Thomas Lehner, director of the Office of Genomics Research Coordination at the National Institute of Mental Health in Bethesda, Md. 


But in recent years, he said, researchers have been searching for differences in micro RNA that might predispose certain people to severe mental illness.


With his academic career in tatters, law enforcement officials say, Mr. Holmes, 24, began to assemble another plan. Over the last two months, he bought two handguns, a shotgun and an assault rifle from local gun dealers. He bought and stockpiled 6,000 rounds of ammunition online. He outfitted himself with black body armor and a gas mask.