PRETORIA, South Africa (CNN) -- Oscar Pistorius gave a dramatic account of the time leading up to the moment when he shot dead his girlfriend Reeva Steenkamp, as he testified Tuesday in his murder trial.
He says he thought he was shooting at an intruder, but the prosecution accuses him of intentionally shooting her in the early hours of Valentine's Day last year after an argument.
Pistorius said he woke in the night to hear the sound of the bathroom window sliding.
"My lady, that's the moment that everything changed," he told the judge.
He described how he got out of bed on his stumps, found his gun under the bed and made his way toward the passage from his bedroom to the bathroom.
The emotion was clear in his voice as he told how he was "overcome by fear."
"There's no barrier between me and the bathroom window. I immediately thought that they could be there at any moment. The first thing that ran through my mind was that I needed to arm myself. I needed to protect Reeva and I and I needed to get my gun," he said.
He said he called to Steenkamp to get down and call police.
Just before he got to the bathroom, he heard a door slam -- the toilet door, he said. It confirmed to him that someone was in the bathroom.
Steenkamp's mother, June, who had listened stony-faced to Pistorius' earlier testimony, sank her head in her hand as he came to the crucial moments before her daughter's death.
Dinner and bedtime
Asked about events earlier in the evening, in his second day on the stand, Pistorius said Steenkamp had offered to cook for him on February 13.
When they went upstairs, Pistorius opened the sliding doors on to the balcony off his bedroom, as it was a very humid evening and the air conditioning was not working, he said.
He placed two fans in the doorway to the balcony, closed the doors as far as possible, and drew the blinds and heavy curtains to prevent insects from coming in.
He said he had locked the bedroom door and put a cricket bat there to block the way in case anyone tried to enter, as he did every night. Pistorius said he also switched on the alarm system in his house every night.
Earlier in the evening, he had placed his firearm under the bed next to a pedestal, he said. He was sleeping on a different side than usual because his shoulder was sore, he said.
Pistorius said that he had asked Steenkamp to bring in the fan and lock the doors when she fell asleep, and that she said she would.
He said he fell asleep between 9 and 10 p.m. and woke up later. Steenkamp then asked him if he couldn't sleep, he said -- and he got up to move the fans. He then heard the noise from the bathroom.
This was the first time he had indicated that Steenkamp was awake in the moments before the drama unfolded.
His lawyer asked for an adjournment so he could change out of his suit, allowing Pistorius to show how short he is without his prostheses on.
The detail is important to his defense because he has said he feels very vulnerable without them on.
Only those in the courtroom can see Pistorius because he has chosen not to testify on camera. His testimony can be heard on an audio feed.
Pistorius: 'I was besotted with her'
Earlier Tuesday, the defense delved deeper into his relationship with Steenkamp as it sought to show they had a loving relationship.
"If anything I was more into her at times than she was with me ... I was besotted with her," Pistorius told the court in Pretoria, South Africa.
The couple met on November 4, 2012, Pistorius said, a little more than three months before Steenkamp died.
Defense lawyer Barry Roux took Pistorius through some of the texts and chat messages exchanged between the couple, as he sought to show that theirs was a loving relationship.
Some of the messages, including ones in which Steenkamp voiced unhappiness about Pistorius' actions, formed part of the prosecution case heard last month. The prosecution contends that Pistorius, 27, intentionally shot Steenkamp, 29, after an argument early on February 14.
In one lengthy WhatsApp message previously cited in court, Steenkamp said, "I'm scared of you sometimes and how u snap at me and of how you will react to me."
Pistorius sought to explain the background to the message Tuesday, saying it was sent on the day of their friend Darren Fresco's engagement party.
"It was a bad day in our relationship," he said. "I think I was just being sensitive, maybe I felt a bit insecure or jealous ... I wasn't kind to her like I should have been."
Pet names and kisses
He sounded emotional as he read another upset message from Steenkamp, in which she said, "I can't be attacked by outsiders and be attacked by you as well, the one person I deserve protection from."
The message, sent on February 7, a week before Pistorius killed her, referred to an evening out after which they argued. He said that Steenkamp, a model and law graduate, had received hate mail for dating him.
But in other, affectionate messages read out in court, the pair used pet names like "baba" and "angel," said they missed each other
and exchanged many "x"s, or kisses.
In one such message, Steenkamp told Pistorius, "Baby I love spending time with you and sleeping next to you."
He replied, "I love having you sleeping next to me baba."
He also described how on one occasion when Steenkamp came to his house, he sprinkled roses on the floor and had chocolates and a heart on his bed to welcome her.
The messages show that Steenkamp slept at Pistorius' house on February 12, 2013. She spent the next day -- the day before her death -- at his house doing laundry, while he had a meeting with his financial adviser. He asked her to stay that night, too.
Roux, for the defense, asked Pistorius about the three weapons charges he faces, separate from the murder charge.
One count concerns an occasion when it's alleged that Pistorius shot a gun through the open sunroof of a car after it was stopped by police for speeding.
His friend Fresco, who was driving the car, and ex-girlfriend Samantha Taylor, who was also present, have previously testified about it.
Pistorius told the court he always had his firearm on him. He said that a policeman who asked whose firearm was in the car was aggressive with him and that he himself was angry that the police officer had handled his weapon.
But he denied firing the gun through the sunroof after the stop.
Asked about another count relating to an occasion when he fired a gun under a table in a restaurant, Pistorius said he had asked Fresco if he could see the firearm.
Pistorius said he wanted to double check that the gun wasn't loaded. As he checked the chamber, a round came out of the breach and discharged, he told the court.
"I was overcome with fear that someone may have been hurt. I couldn't really believe what had happened. I was quite angry initially that Mr. Fresco had handed me an unsafe firearm," he said.
Pistorius said he was also partly to blame for asking for the gun.
Pistorius: 'She felt loved'
When he first took the stand Monday, Pistorius began with an emotional apology to Steenkamp's family, saying he woke up thinking of them and praying for them every day.
"I can't imagine the pain and the sorrow and the emptiness that I have caused you and your family. ... I can promise you that when she went to bed that night, she felt loved," he said, his voice breaking as if he was fighting back tears.
Pistorius testified that he has been suffering nightmares since the killing and wakes up smelling blood.
He told the Pretoria court that he is afraid to sleep, and "if I hear noise, I wake up just in a complete state of terror." He said he is on medication, including an antidepressant and sleeping pills.
It was the first time he has spoken in public about Steenkamp's death, which he says was an accident. He pleaded not guilty to murder when the high-profile trial opened early last month.
June Steenkamp sat impassively as South Africa's onetime Olympic golden boy choked out his statement.
Pistorius admits that he killed Steenkamp, firing four shots through a closed door in his house in the early hours of February 14, 2013. Three hit her, with the last one probably killing her almost instantly, according to the pathologist who performed the autopsy.
But Pistorius says he thought she was a nighttime intruder in his pitch-black house and believed he was firing in self-defense.
The defense team will call 14 to 17 witnesses, Roux said as he opened his case. The trial is scheduled to continue until the middle of May.
Judge Thokozile Masipa will decide the verdict in collaboration with two experts called assessors. South Africa does not have jury trials.
CNN's Richard Allen Greene reported and wrote from London; Emily Smith reported from Atlanta, and Laura Smith-Spark wrote in London. CNN's Nicola Goulding, Marie-Louise Gumuchian and legal analyst Kelly Phelps contributed to this report.
™ & © 2014 Cable News Network, Inc., a Time Warner Company. All rights reserved.