A masked gunman killed 12 people and wounded over 50 others when he opened fire on moviegoers at a showing of new Batman film "The Dark Knight Rises" in Denver, Colorado, early this morning.

Police said the gunman appeared at the front of the cinema during the film and released a canister which let out a hissing sound before gunfire erupted.

A number of children, including a six-year-old child and a three-month-old baby were among the injured. A total of 71 people were shot during the attack.

The suspect also booby-trapped his Aurora apartment with sophisticated explosives, creating a hazard for law-enforcement and bomb squad officers who swarmed to the scene.

Authorities evacuated five nearby buildings, and created a perimeter of several blocks.

Officers took the suspect into custody in the car park behind the cinema, where he surrendered without a fight, police said.

The suspect was identified as James Eagan Holmes, 24, a University of Colorado medical school student who was in the process of dropping out of a graduate programme in neurosciences, the university said in a statement.

His family issued a statement of sympathy for the victims and asked for privacy while they "process this information."

President Barack Obama urged Americans to "stand together" with the people of Aurora in the hours and days to come.

The gunman was armed with a high-powered rifle, a shotgun and two pistols. He was also wearing a bulletproof vest.

Aurora Police Chief Dan Oates said police were trying to determine how to disarm the flammable or explosive material at Mr Holmes' apartment and said they could be at the scene for hours or days.

"The pictures are fairly disturbing. It looks very sophisticated, how it's booby-trapped. It could be a very long wait," he added.

CNN quoted one witness as saying he saw a "guy slowly making his way up the stairs and firing, picking random people."

Another witness said the gunman opened fire during a shoot-out scene in the movie, leading to confusion.

A witness told CNN: "We heard anywhere from 10 to 20 shots and little explosions going on. Shortly after that we heard people screaming. Then they came on PA system and said everyone needed to get out.

"As soon as we got out, there were people running around and screaming."

He said friends had told him the gunman was wearing a gas mask.

Police received the first call about the shooting at 12.39am local time (7.39am Irish time) and responded within "a minute or two".

Local hospitals were alerted to a "mass casualty incident".

Ten people died at the scene and two died later in hospital.

A spokeswoman for Denver's Swedish Medical Center said three people had been admitted to that hospital with gunshot wounds and were in critical condition.

Another hospital, Denver Health, said that they had received six wounded, one of whom was in critical condition.

In a statement, Mr Obama expressed shock and sadness at the shooting.

"As we do when confronted by moments of darkness and challenge, we must now come together as one American family," he said.

"This is one of the most horrific nights I've ever had to work," said Comilla Sasson, an emergency doctor at University of Colorado Hospital in Aurora where 22 patients ranging in age from three months to 45 years arrived in private cars, police cars and ambulances.

US military personnel apparently were among the casualties but it was not immediately clear whether any were killed, the US Defense Department said.

Buckley Air Force Base is the largest employer in Aurora, a city of more than 320,000 people, according to the Aurora Economic Development Council.