Reeva Steenkamp, a 29-year-old law graduate and model, died after being hit by three rounds from a 9-mm pistol, prosecutor Gerrie Nel said.
Pistorius, 26, wept uncontrollably in court as Nel outlined details of a shooting that has stunned South Africa and the millions around the world who saw the double amputee's track glory as an inspiring tale of triumph over adversity.
Later, in a dramatic affidavit read out by defence lawyer Barry Roux, Pistorius said he had been "deeply in love" with Steenkamp, whom he had been dating since November, and had no intention of killing her.
Having had previous death threats and break-ins, Pistorius said he slept with a 9-mm pistol under his bed in his plush Pretoria home in the heart of a well-secured gated community.
He and Steenkamp went to sleep on Wednesday night - the eve of Valentine's Day - some time after 10 p.m., he said.
However, in the middle of the night, he awoke in pitch darkness and thought an intruder had climbed through a window and entered the toilet, Pistorius said.
Without putting on his prosthetic legs - contrary to the prosecution's version of events - he moved on his stumps into the bathroom adjoining his bedroom and noticed the closed toilet door. He did not realise Steenkamp was behind it, he said.
He shouted for the intruder to get out of his house then fired several shots into the door, before calling to Steenkamp to phone the police.
When she did not respond, he grabbed a cricket bat to beat down the bathroom door and found her slumped on the floor, he said.
"I was absolutely mortified by the events and the devastating loss of my beloved Reeva," he said in the affidavit.
As Roux read the statement, Pistorius sobbed unrestrainedly, prompting magistrate Desmond Nair to halt proceedings for several minutes. "You need to concentrate on what's going on," Nair told him.
The bail hearing was adjourned until 0700 GMT on Wednesday.
Nearly 1,000 km away, on South Africa's windswept southern coast, scores of mourners gathered under cloudy skies in the city of Port Elizabeth for Steenkamp's funeral.
Amid the grief, there was little sympathy for Pistorius, who at the time was weeping on a wooden bench in the spartan, brick-face courtroom in the capital.
"She was an angel. She was so soft, so innocent. Such a lovely person. It's just sad that this could happen to somebody so good," said Gavin Venter, an ex-jockey who worked for Steenkamp's father.
"I'm disgusted with what he did. He must be dealt with harshly," he added, shortly before Steenkamp's cremation in the Victoria Park Crematorium. "Without a doubt he's a danger to the public. He'll be a danger to witnesses. He must stay in jail."
The case has drawn further attention to endemic violence against women in South Africa after the gang-rape, mutilation and murder of a 17-year-old near Cape Town this month.
Members of the Women's League of the ruling African National Congress protested outside the Pretoria court, waving placards saying: "No Bail for Pistorius" and "Rot in jail".
Before Pistorius's testimony, Nel, the lead prosecutor at the hearing, painted a picture of premeditated killing - a crime that carries a life sentence in South Africa.
"If I arm myself, walk a distance and murder a person, that is premeditated," he told the packed courtroom. "The door is closed. There is no doubt. I walk seven metres and I kill."
"The motive is 'I want to kill'. That's it," he added. "This deceased was in a 1.4 by 1.14 metre little room. She could go nowhere. It must have been horrific."
The arrest of Pistorius stunned the millions who had watched in awe last year as the Olympic and Paralympic sprinter reached the semi-final of the 400 metres in the London Olympics, running on high-technology carbon fibre 'blades'.
But the impact has been greatest in sports-mad South Africa, where Pistorius was seen as a rare hero who had transcended the racial divides that persist 19 years after the end of apartheid.
He carried South Africa's flag at the closing ceremony of the London Olympics, and U.S. magazine Sports Illustrated named him as one of the most inspiring figures of the year.
"Many questions are being asked, but we have no answers," Sports Minister Fikile Mbalula said in a statement.
The sprinter's endorsements and sponsorships included sportswear giant Nike, British telecoms firm BT, sunglasses maker Oakley and French designer Thierry Mugler and were thought to be worth as much as £1.3 million a year.
In his affidavit, Pistorius said he earned £407,000 a year and owned properties worth nearly £650,000.
However, Nike and Mugler both said they had dropped Pistorius from advertising campaigns, while cosmetics firm Clarins said it was recalling its 'A Man' perfume range out "respect and compassion towards the families involved".
Other sponsors have said they will make no decisions until the legal process has run its course.
Born without a fibula in either leg, Pistorius had his lower legs amputated as an 11-month-old baby but became the highest-profile athlete in the history of the Paralympic Games.
After the hour-long private ceremony in the cream-coloured hill-top church in Port Elizabeth, Steenkamp's brother Adam and uncle Mike, fighting back tears, spoke briefly to reporters.
"There's a space missing inside all the people that she knew that can't be filled again," Adam Steenkamp said. "We are going to keep all the positive things that we remember and know about my sister. We will miss her."