Danish inventor Peter Madsen has denied murdering Swedish journalist Kim Wall aboard his self-built submarine last year, telling a court that he disposed of her body after she died breathing in exhaust fumes.
On the first day of his trial in Copenhagen, the 47-year-old said he had to dismember the corpse to get it out of the submarine.
He intended to dispose of the body parts at sea to restore a "normal" condition on board, he said, admitting that he was not thinking rationally at the time.
Madsen is accused of murdering and dismembering Ms Wall, a 30-year-old Swedish journalist who was researching a story on the man who was already well known in Denmark for his submarines and his plan to send a human into space in a home-made rocket.
Ms Wall disappeared after Madsen took her out to sea in his 17m submarine last August.
Later that month, police identified a torso washed ashore in Copenhagen as Ms Wall's.
He is also accused of sexual assault, prosecutor Jakob Buch-Jepsen told the court.
Prosecutors said Ms Wall died either by strangulation or having her throat cut.
Madsen faces up to life in prison if convicted.
"I plead not guilty to the voluntary manslaughter of Kim Wall," Madsen told the court.
Under the Danish penal code, manslaughter is used to describe the deliberate killing of a person and there is no distinction between manslaughter and murder.
Madsen told the court that Ms Wall had died from breathing exhaust gases that had leaked into the submarine due to a technical error, while he was on the deck of the vessel preparing for to submerge.
"When I turn to open the hatch cover, the most terrible minutes of my life begin. I cannot open the hatch, because the engine is sucking air from the cabin," he said. "Then I hear Kim calling."
After eventually opening the hatch, he said: "I crawl down and find Kim Wall lifeless. I kneel beside her and pat her on the cheeks."
He has previously admitted to dismembering her body and dumping the body parts at sea.
Prosecutor Buch-Jepsen said Madsen had searched the internet for "beheading girl" just hours before the trip, and had videos of real killings of women on his computer.
He denied in court having had any sexual relations with Ms Wall.
The trial is scheduled over 12 court hearings, with a verdict expected on 25 April.