For a short while, Oscar Pistorius had maintained his composure in the dock, his face a wan and weary mask. Then came his account of what happened the night Reeva Steenkamp died, read by his defence lawyer, and the mask cracked.

Pistorius's whole body shook and he wept uncontrollably, as if a chasm of grief threatened to swallow him. The magistrate halted proceedings for a few minutes, explaining: "My compassion as a human being does not allow me to just sit here."

This was the tense, taut-as-a-drum atmosphere at the bail hearing in court C in Pretoria magistrates court on Tuesday, as prosecutors built a case of premeditated murder against Pistorius and one of the world's most famous athletes gave his version of events for the first time.

The prosecution asserted that Pistorius had "shot an unarmed and innocent woman" after getting out of bed, putting on his prosthetic legs and walking seven metres to fire through the locked door of the toilet. Pistorius, 26, admitted shooting his girlfriend but claimed that he had panicked in the dark and mistaken her for a burglar.

The magistrate, Desmond Nair, ruled that the charge against Pistorius would be categorised as the most serious possible under South African law, dealing a blow to his hopes of securing bail. Pistorius visibly trembled at the decision while his tearful family gathered in a small circle, arms around each other, as cameras clicked and filmed from every angle.

As a day of drama and riveting testimony in the sweltering courtroom unfolded, Steenkamp, a model seen on numerous magazine covers, was cremated hundreds of miles away at an emotional funeral service in Port Elizabeth. The mood among more than 100 family members and friends was described as a combination of sadness and anger.

Pistorius, wearing a dark suit – at one point his brother leaned forward to turn down the collar – blue shirt and dark patterned tie, with a white tissue between his fingers, cut a mournful figure in the dock.

His eyes were dark and hooded as if sore from crying, his shoulders sagged from time to time and his head bowed repeatedly. He spoke only to say "yes, sir", or "yes, your worship" softly to the magistrate a few times.

Pressing for a charge of premeditated murder, the prosecutor, Gerrie Nel, said Steenkamp had been shot three times in a small 1.4m x 1.14m room where she was cowering after a shouting match. He dismissed Pistorius's claim that he thought she was a burglar as "all part of the pre-planning". He asked: "Why would a burglar lock himself inside the bathroom?"

Even if the burglar theory had been true, he added, it "still constitutes premeditated murder" because Pistorius knowingly opened fire on what he believed to be a defenceless burglar.

It was left to the defence advocate, Barry Roux, to read Pistorius's sworn affidavit to the court, in which barely any floor space was visible beneath a chaotic scrum of officials, family members and reporters, photographers and TV crews with equipment.

A hush descended as the statement of Oscar Leonard Carl Pistorius began.

"I fail to understand how I could be charged with murder, let alone premeditated murder, as I had no intention to kill my girlfriend," Pistorius insisted.

The Olympian and Paralympian claimed that, on 13 February, Steenkamp called him and suggested they spend the evening at his home, where they had a quiet dinner. By 10pm, the court heard, they were in the bedroom, she doing yoga and he in bed watching television, his prosthetic legs off. She then got into bed and they both fell asleep.

"We were deeply in love and could not be happier. I know she felt the same way. She had given me a present for Valentine's Day but asked me only to open it the next day."

Pistorius said he was "acutely aware" of violent crimes committed by intruders. He had received death threats in the past and had been a victim of violence and burglary. For that reason, he kept a 9mm Parabellum pistol under his bed at night.

The athlete woke up in the early hours of 14 February, he added, and went on to the balcony to bring a fan in and close the sliding doors, blinds and curtains.

"I heard a noise and realised that someone was in the bathroom. I felt a sense of terror rushing over me. There are no burglar bars across the bathroom window and I knew that contractors who worked at my house had left the ladders outside. Although I did not have my prosthetic legs on I have mobility on my stumps.

"I believed that someone had entered my house. I was too scared to switch a light on. I grabbed my 9mm pistol from underneath my bed. On my way to the bathroom I screamed words to the effect for him/them to get out of my house and for Reeva to phone the police. It was pitch dark in the bedroom and I thought Reeva was in bed."

He went on: "I noticed that the bathroom window was open. I realised that the intruder/s was/were in the toilet because the toilet door was closed and I did not see anyone in the bathroom. I heard movement inside the toilet. The toilet is inside the bathroom and has a separate door.

"It filled me with horror and fear of an intruder or intruders being inside the toilet. I thought he or they must have entered through the unprotected window. As I did not have my prosthetic legs on and felt extremely vulnerable, I knew I had to protect Reeva and myself.

"I believe that when the intruder/s came out of the toilet we would be in grave danger. I felt trapped as my bedroom door was locked and I have limited mobility on my stumps.

"I fired shots at the toilet door and shouted to Reeva to phone the police. She did not respond and I moved backwards out of the bathroom, keeping my eyes on the bathroom entrance. Everything was pitch dark in the bedroom and I was still too scared to switch on a light. Reeva was not responding.

"When I reached the bed, I realised Reeva was not in the bed. That is when it dawned on me that it could have been Reeva who was in the toilet. I returned to the bathroom calling her name. I tried to open the toilet door but it was locked. I rushed back into the bedroom and opened the sliding door exiting on to the balcony and screamed for help."

Pistorius put on his prosthetic legs, ran back to the bathroom and tried to kick the toilet door open, he said. He went back to the bedroom to grab his cricket bat and smash open the toilet door. One or more panels broke off and he found the key so he was able to open it.

"Reeva was slumped over but alive. I battled to get her out of the toilet and pulled her into the bathroom."

Pistorius said he called an administrator of his estate and asked him to phone an ambulance and also called a private hospital. He carried Steenkamp, 29, downstairs so she could be taken to hospital. "Downstairs, I tried to render the assistance to Reeva that I could, but she died in my arms."

Pistorius reflected: "I am absolutely mortified by the events and the devastating loss of my beloved Reeva. With the benefit of hindsight I believe that Reeva went to the toilet when I went out on the balcony to bring the fan in. I cannot bear to think of the suffering I have caused her and her family, knowing how much she was loved.

"I also know that the events of that tragic night were as I have described them and that in due course I have no doubt the police and expert investigators will bear this out."

The court also heard affidavits from friends of the couple. They spoke of how Pistorius and Steenkamp seemed very happy together, even if he was moving a little too fast for her in the relationship.

One said: "Oscar told me Reeva could be the girl he would one day marry."

Another, named Samantha, recalled: "Reeva told me that she really liked Oscar and they both clicked and understood each other." Pistorius treated her "like gold", Samantha added. "Reeva said if Oscar asked her to marry him, she would probably say yes."

At that, Pistorius bowed his head and wept.

Earlier, the prosecutor told the court that Steenkamp had arrived at the house in a gated community at about 6pm on 13 February with an overnight bag.

He said Pistorius fired four times into the door of the toilet where Steenkamp had taken refuge after an argument. Three of the bullets hit her, Nel said.

"She couldn't go anywhere," Nel argued. "You can run nowhere ... It must have been horrific."

"The applicant armed himself, attached his prosthesis, walked seven metres to the bathroom and shot the deceased while she was in the toilet," he continued.

It was not, he argued, a case of "there was someone standing over my bed", something which might cause a spontaneous reaction.

"He shot four times ... There's no possible explanation to support his report that he thought it was a burglar ... If I arm myself, walk a distance and murder a person, that is premeditated. The door is closed. There is no doubt. I walk seven metres and I kill."

The "cold facts" added up to premeditated murder, he added.

Nel said the prosecution was giving details only relevant to the bail hearing and would present its full case later. "The broken door is important. She was there, she locked the door for a purpose, I'm not allowed to give you that purpose now."

Pistorius sobbed as his lawyer insisted the shooting was an accident and that there was no evidence to substantiate a murder charge.

"Was it to kill her, or was it to get her out?" he asked about the broken-down door. "We submit it is not even murder. There is no concession this is a murder."

He said the state had provided no evidence that the couple quarrelled or offered a motive. Nel rebutted: "The motive is 'I want to kill'."

Pistorius won two gold medals and one silver at the London Paralympics last year. The court heard that Pistorius's house is valued at 5m rand (£360,000) and he owns two further properties worth a total of 1.6m rand. His occupation as an athlete provides him with about 5.6m rand a year, and he has cash investments in excess of 1m rand a year.