A Danish inventor admitted dismembering a Swedish journalist, whose body parts were found at sea after she went missing Aug. 10 — but he denied killing her.

Peter Madsen also changed his story to claim that Kim Wall, who’d been interviewing him for a story, had died of carbon monoxide poisoning while on board his homemade vessel.

Madsen initially told police she died in a “terrible accident” when a heavy submarine hatch fell on her head.

The 30-year-old Columbia Journalism School grad was found stabbed in her ribcage and genitals more than a dozen times “around or shortly after her death,” prosecutors have said.

Madsen has pleaded not guilty.

With Post wires