South African athletics star Oscar Pistorius has denied murdering his girlfriend, saying he shot her by mistake thinking she was an intruder.
He told a packed bail hearing in Pretoria that he loved Reeva Steenkamp and never intended to kill her.
Prosecutors accuse Mr Pistorius of premeditated murder. They say he shot his girlfriend dead deliberately, firing through a locked bathroom door.
The hearing came as Ms Steenkamp's family held a funeral for her.
The case has shocked South Africans and many around the world who admire Oscar Pistorius for overcoming adversity to become a Paralympic champion.
Tuesday's hearing began with the prosecution giving its account of the killing, which it says was premeditated murder by the 26-year-old athlete at his home in Pretoria.
Prosecutor Gerrie Nel told the court that in the early hours of the morning of 14 February, Mr Pistorius - a double amputee - had got up from bed, put on his prostheses, and fired his pistol through the locked door of the bathroom.
He shot four times and hit Ms Steenkamp three times, Mr Nel said.
He added that the defendant later broke down the bathroom door with a cricket bat and carried the body downstairs.
Defence lawyer Barry Roux then read a sworn statement from Mr Pistorius, saying the couple had been "deeply in love".
The couple went to sleep shortly after 22:00, the statement said.
In the middle of the night Mr Pistorius woke up and went to the balcony because he thought he heard an intruder, it added.
"It was pitch-dark in the bedroom. I did not have my prosthetic legs on and felt extremely vulnerable."
According to the statement, Mr Pistorius thought Ms Steenkamp was still in bed, and he fired through the bathroom door, believing he was shooting at a robber.
When he realised Ms Steenkamp was not in the bed, "it filled me with horror and fear", it said.
Mr Pistorius broke the door down to find his girlfriend shot inside.
"She died in my arms," the statement said. "I am absolutely mortified at the death of my beloved Reeva".
The athlete wept in court as the statement was read out.
The hearing was later adjourned until Wednesday.
Meanwhile, the private funeral for the 29-year-old model and law graduate was held in her home town of Port Elizabeth.
Her father, Barry Steenkamp, told reporters: "We have to keep Reeva in our hearts forever".
Her brother Adam said there was "a space missing" inside all the people she knew.
The case has aroused huge interest both in South Africa, where Oscar Pistorius is regarded as a national hero, and around the world.
He is a multiple Paralympic champion, winning gold medals at the 2004 Games in Athens, at Beijing 2008 and at London 2012.
In London he made history by becoming the first double amputee to run in the Olympics, progressing to the semi-finals of the 400m,