But the prosecution painted a picture of a sexual sadist obsessed with beheadings who murdered her as part of a sexual fantasy.
Madsen, who has previously admitted dismembering Wall's body and throwing her remains overboard, told the Copenhagen district court on the first day of his trial that the air pressure suddenly dropped in the engine room, where the 30-year-old freelance reporter was located while he was up on deck.
Pleading not guilty to premeditated murder, he admitted he had lied to investigators and changed his account of what actually happened to Wall several times.
“I'm not interested in much other than Kim Wall's family. I did not want to tell anyone how Kim Wall died,” Madsen said at the court according to Ritzau's report.
“I think most people lie to protect others,” Madsen also said.
“I wanted to spare her family and the world the details … about what actually happened when she died, because it is gruesome.”
He said a vacuum effect meant he was unable to open the hatch to get in to Wall, who was screaming for help.
“I try to explain to Kim through the hatch how to stop the necessary engines, for 5 to 15 minutes I try to get in to her,” Madsen said.
“When I finally manage to open the hatch, a warm cloud hits my face. I find her lifeless on the floor, and I squat next to her and try to wake her up, slapping her cheeks.”
He said he sailed around for a few hours, contemplating suicide, and then slept next to Wall's body for two hours.
Cutting her up was not a big deal, as he already knew how to amputate limbs “to save lives”.
“I don't see how that mattered at that time, as she was dead,” Madsen said with a small grin.
“I tried first with an arm, and that went very fast… It went very fast, and I got her out of the submarine.”
Wall's chopped up body parts, weighed down in plastic bags with metal objects, were later recovered from waters off Copenhagen.
'I'm still alive'
Wall was reported missing by her boyfriend after she failed to return home from her trip on the 60-foot (18-metre) vessel on August 10.
That evening, the couple were having a going-away party ahead of their planned move to China a few days later.
But Madsen, an eccentric semi-celebrity in Denmark who dreamed of developing private space travel and whom Wall had been trying to interview, contacted her and invited her out to the sub.
On a large screen in the courtroom, the prosecutor showed a series of text messages Wall sent her boyfriend from inside the vessel.
“I'm still alive btw (by the way),” she wrote, adding: “But going down now!” and “I love you!!!!!!”
A minute later, she added: “He brought coffee and cookies tho.”
Madsen first told police he dropped Wall off on an island, then said the hatch door fell on her head, then suggested she may have died of carbon monoxide poisoning.
Asked why he kept changing his account, he said his approach at the time was to “stick to my explanation (of an accident) until your evidence means that I have to tell how she died.”
An autopsy was unable to determine her cause of death, nor has a motive been established.
According to the prosecutor, the 47-year-old amateur engineer brought a saw, sharpened screwdrivers, nylon straps and other implements on board the submarine before sailing into the Öresund waters separating Denmark and Sweden with Wall on August 10th.
He insisted the voyage was not part of a sinister plan and also claimed that Wall, who had agreed to the trip as part of her work on a feature for American magazine Wired, was enjoying herself “until the accident happened”.
Prosecutors cited a psychological assessment which declared him “a perverted polymorph, and highly sexually deviant”.
“He has narcissistic and psychopathic traits, and is manipulating, with a severe lack of empathy and remorse,” prosecutor Jakob Buch-Jepsen said.
He said evidence showed Madsen bound Wall by the head, arms and legs before beating her and stabbing her repeatedly in her genital area.
Buch-Jepsen said Madsen then killed her — probably strangling or slitting her throat — and cut her up with a saw, stuffing her torso, head, arms and legs in separate bags weighed down with metal objects, and dumping them in Koge Bay off Copenhagen.
Prosecutors also introduced as evidence a hard drive seized in his workshop containing fetish films, in which women were tortured, decapitated and burned alive.
Seven texts “about impalement of women, mostly in the genitals” were also found.
Madsen has said the hard drive was not his.
Investigators never found Wall's or Madsen's phones, but were able to recreate some of the messages on them.
On the morning of August 10, Madsen “googled 'beheaded girl a(r)gony' which leads to a video of an unidentified young woman who is slowly having her throat cut,” the prosecutor said.
On July 26, he also googled “female beheading” and watched the videos.
Asked why he watched the videos, Madsen said: “It is not of a sexual nature. This is about strong emotions. I watch these videos to cry and to feel emotions.”
Madsen's defence lawyer said the prosecution's case didn't hold up.
“If these statements as presented by the prosecutor can be proven, it would be very incriminating for my client. However there is not enough proof,” Hald Engmark told the court.
The prosecution has said it will seek a life sentence, which in Denmark averages around 16 years. A verdict is expected on April 25.