PRETORIA, South Africa — His voice shaking, Oscar Pistorius took the witness stand Monday for the first time, testifying he was trying to protect the girlfriend he killed and that he became so tormented by memories of the fatal shooting and panic attacks that he once hid helplessly in a closet.

Pistorius also offered an apology to the family of Reeva Steenkamp, who died from multiple wounds after the double-amputee runner shot her through a closed toilet door last year in his home. He said he mistook Steenkamp for an intruder. Prosecutors allege he killed her after an argument.

“There hasn’t been a moment since this tragedy happened that I haven’t thought about your family,” the Olympian said at the murder trial as Steenkamp’s mother, June, looked impassively at him in the courtroom.

“I was simply trying to protect Reeva. I can promise that when she went to bed that night she felt loved,” Pistorius said.

Pistorius’ display of anguish and remorse was a marked departure from the testimony of some prosecution witnesses whose accounts painted a picture of the runner as a hothead with a jealous streak, an inflated sense of entitlement and an obsession with guns in the months before he killed Steenkamp, 29, a model.

He has yet to be cross-examined about the shooting in the early hours of Feb. 14, 2013, and that testimony is likely to be the centerpiece of a trial being followed around the world. Pistorius was charged with premeditated murder and faces 25 years to life in prison if convicted. Some analysts said the judge, who will decide the case, will consider a lesser charge such as homicide, which could still lead to prison for years.

Pistorius, 27, spoke in a soft, quavering voice at the start of his testimony, forcing Judge Thokozile Masipa to ask him to speak more loudly. He stood at first, stifling sobs as he said he was on antidepressants and sometimes woke from nightmares to the “smell of blood.”

Defense lawyer Barry Roux, who had aggressively challenged prosecution witnesses, led Pistorius gently through events in a life that was held up, in the runner’s heyday, as an inspiring tale. Pistorius was born without fibula bones because of a congenital defect, and his legs were amputated when he was 11 months old. He ran on carbon-fiber blades and is a multiple Paralympic medalist. He also competed at the London Olympics but didn’t win a medal.

Pistorius will return Tuesday to continue testifying after the judge granted an early adjournment because she said Pistorius looked “exhausted.”