Journalist Kim Wall died after she was hit by a hatch cover aboard the homemade Nautilus submarine, the Danish inventor charged with killing her testified in court Tuesday.

In the first public hearing since being arrested on Aug. 11, Peter Madsen, 46, said he had been holding the hatch for 30-year-old Wall and slipped, causing the 155-pound cover to fall on the journalist, who then bled to death from an open skull fracture.

"I lost my foothold and the hatch shuts," Madsen said, according to Sky News. "Kim had been severely hurt and was laying with an intense bleeding. There was a pool of blood where she had landed."

Madsen claimed the accident happened as the pair were sailing in the strait between Denmark and Sweden.

He then explained the accident horrified him and he hauled her up using a rope, which resulted in her clothes being pulled off. He then dropped her body into the sea and intended to commit suicide.

Special prosecutor Jakob Buch-Jepsen also pressed Madsen about his sexual desires, and if he has been interested in "suffocation sex," according to the Danish BT tabloid.

Madsen acknowledged he and his wife live in an open relationship and that he has had contact with the sadomasochist environment, BT reported.

"No, but many years ago, with a mistress in an erotic roleplay, I told her that she should hold her breath. But it was her own invitation," he said in court, according to the BT tabloid.

The inventor stressed his relationship with Wall was exclusively professional, that she was going to interview him and nothing else.

The hearing Tuesday was not aimed at determining Madsen's guilt, but rather whether there was sufficient evidence to maintain his detention as police investigate, which a judge later said there was.

Madsen appeared calm in court, though irritated by the prosecution, according to the Associated Press.

Wall's naked, headless body was found Aug. 21 on a Copenhagen beach, 10 days after she was last seen entering Madsen's sub as part of a story she was writing.

Police said earlier Wall's head, arms and legs had been deliberately cut off and a piece of metal had been attached to the torso "likely with the purpose to make it sink." Police also said marks on the torso indicated that someone had tried to press air out of the body so it wouldn't float.

Copenhagen Police, who are still searching for Wall's head and the location and manner of her death, brought in a mobile truck scanner typically used to scan shipping containers last week to search for any hidden compartments on board.

The 40-ton, nearly 60 foot-long submarine, which sank earlier this month, now stands on land in a remote corner of Copenhagen's harbor.

The inventor was detained after being rescued Aug. 11 from the submarine and charged with indecent handling of a corpse.

Strict reporting restrictions in Danish courts mean only limited information has been available on the case, but the cause of Wall's death has not been determined, according to Sky News.

Wall's family has set up a crowdfunding campaign to raise donations for the "Kim Wall Memorial Fund" -- a grant that will fund a young female reporter.

The Associated Press contributed to this report.