Danish inventor Peter Madsen allegedly texted a friend details of a murder on a submarine, just days before journalist Kim Wall's death.

Madsen has been charged with the murder and dismemberment of Wall, whose headless torso was found floating in Copenhagen harbour. She had 15 stab wounds around her vagina.

In January, he pleaded guilty to indecent handling of a corpse, but denied killing Wall.

It has now emerged that Madsen sent details of a murder plot which takes place on a submarine to a friend and recent sexual partner.

"He says he has a murder plan ready in the submarine, and I tell him I am not afraid, you have to be more threatening. He talks about the tools he wants to use, and I say, 'Oh it's not threatening,'" the woman told a Wired reporter, who pieced together Wall's final hours.

Madsen then envisaged inviting a friend to the submarine and together "cutting her up", according to the Wired article.

The inventor's friend said the troubling exchange occurred after she asked to "motivate her with a threat" when she was struggling to meet a deadline. She said she thought little of the dark content of the texts at the time, but that she has now handed them over to the police.

The Wired journalist also spoke to several of Madsen's colleagues, one of who described a situation when the inventor "would pretend to be a violent Nazi and would mime hitting" him.

He said that lots of Nazi jokes were made at Madsen's workshop and that staff gave each other Nazi nicknames. Madsen told the others to call him Kaleun, a nickname for Kapitänleutnant and reference to the film 'Das Boot', which tells the story of a fictional German U-boat unit during World War II.

Police found violent footage of women being tortured, dismembered and burned on the inventor's hard drive after he was charged with Wall's murder.

"We think it's video recordings of true killings of women," Special Prosecutor Jakob Buch-Jepsen said, adding that some of the footage appeared to depict "decapitation and burning."

Peter Madsen submarine
Swedish journalist Kim Wall
Peter Madsen was charged with the murder and dismemberment of journalist Kim Wall in January.