A moviegoer told jurors at the Colorado murder trial of James Holmes Tuesday she initially thought she was witnessing a prank when an emergency exit opened and a gunman burst in, then her thoughts turned to the baby inside her when she realized her life was in danger.

Katie Medley’s testimony came during the first day of witness examination in the widely-anticipated trial of Holmes, the 27-year-old former neuroscience student whose lawyers say was insane on July 20, 2012, when he gunned down a dozen moviegoers at an Aurora, Colo, cinema’s midnight screening of the Batman movie “The Dark Knight Rises.”

"I remember at one point I saw the shooter walk by our row, and because I was so pregnant, I had to save my unborn child."

- Katie Medley

"We were just watching the movie and I noticed that the exit to the right opened up,” Medley said, as her husband, Caleb, who was left paralyzed in the attack, watched inside the courtroom. “I told [friend] Ashley [Kurz], I think someone’s doing a prank right now that’s going to be very funny.”

Medley, who was pregnant at the time and later gave birth to a boy named Hugo, said the grim reality sank in quickly, as Holmes lobbed tear gas canisters into the aisles and opened fire indiscriminately on patrons about 15 minutes into the movie.

Caleb, Medley said, “had a lot of blood pouring into his mouth and he was choking on the blood.” As Holmes passed their seats, she cowered on the floor praying for her baby.

"We thought the shooter was going to go row by row and just kill us," she told a 12-member jury, winnowed down from a record pool of more than 9,000. "The air was very thick and it was hard to breathe.

"I remember at one point I saw the shooter walk by our row, and because I was so pregnant, I had to save my unborn child."

She said she told her wounded husband that, "I loved him and that I would take care of our baby if he didn't make it."

As she and her friend left, she said she had to step over bodies on the floor and then slipped in a large amount of blood. A police officer caught her.

Caleb Medley, who suffered brain damage and was left unable to walk, took the stand briefly. He answered only "yes" when asked if he was present at the theater that night -- his speech noticeably impaired as he sat in a wheelchair.

As witnesses testified about the night of carnage, Holmes, wearing a blue and purple patterned shirt with navy slacks, swiveled in his chair at the defense table. The audience and the jury appeared emotional a few times, especially during Caleb Medley's brief appearance.

Also testifying Tuesday was Munirih Gravelly, who came to the movies with Jesse Childress. Childress died shielding Gravelly, who was hit in the head, arm and hand by shotgun pellets. Other witnesses, many among the 70 injured patrons, were also expected to testify, including Joshua Nowlan, who was shot through his right arm and left leg.

James Holmes' sanity at the time he gunned down 12 people in a Colorado movie theater went on trial Monday, more than 1,000 days after the shooting spree that shocked the nation.

Holmes has pleaded not guilty by reason of insanity. On Monday, during opening statements, District Attorney George Brauchler described Holmes as a superior intellect who felt rejected by the world and harbored a hatred of mankind. He pledged to bring forward top mental health experts who evaluated Holmes and concluded he was sane at the time of the attack.

“One guy felt as if he had lost his career, lost his love life, lost his purpose,” said Brauchler, who ticked off short bios of each of the 12 murder victims.

Holmes had foreshadowed his attack with previous pledges to kill, and on the night of the spree, had taken steps to escape, including bringing $280 cash, tire-flattening tacks to throw out the window of his car during a pursuit and yet another handgun he did not take into the theater.

Lead defense attorney Daniel King and attorney Katherine Spengler argued that Holmes was indeed insane at the time of the attack following Brauchler's arguments.

The attack occurred at 12:30 a.m. on July 20, 2012, when the California native burst into the Century 16 theater dressed in black body armor and a gas mask. As stunned moviegoers watched, some reportedly thinking they were witnessing a prank connected to the film, Holmes set off tear gas grenades and began firing into the audience with an arsenal that included a 12-gauge shotgun, a semi-automatic rifle and a Glock 22 40-caliber handgun.

By 12:45, police had arrested Holmes, who was found next to his car which was parked behind the cinema. They later determined Holmes had bought a ticket and sat in the front row before sneaking out an emergency exit 20 minutes into the film. He left the door propped open with a piece of plastic, and returned to wreak carnage.

Holmes faces 166 murder, attempted murder and other charges in the attack. His attorneys maintain he was "in the throes of a psychotic episode when he committed the acts," but prosecutors said the crime was so intentionally heinous it deserves the death penalty. Two court-ordered psychiatric exams that could determine the verdict were withheld from the public.

Holmes’ downward spiral prior to the shooting is well-documented. His graduate studies in neuroscience had fallen apart, and he had told a classmate he wanted to kill people, prosecutors say. He had stopped seeing his psychiatrist, then sent her text messages so threatening that she alerted University of Colorado campus police. He even mailed her his journal, in a package with burned $20 bills.

In his apartment, which police found booby-trapped with explosives, he stockpiled weapons, more than 6,000 rounds of ammunition, tear gas grenades and riot gear.

FoxNews.com's Cristina Corbin and Jennifer Girdon contributed to this report.