They were going to die together, he said.
The man pulled out a hunting knife with a 20cm blade and threatened to stab himself in the stomach.
He threw the weapon aside and grabbed strong painkillers he had been prescribed. He made the victim swallow one while he downed nine, the court heard.
The defendant took the battery and sim card from the victim's phone and turned the gas stove on.
''It is a 9kg gas bottle and it will take a long time to die,'' the defendant said.
The man went outside, parked his car against the unit's door to prevent escape and hauled himself in through a bathroom window.
The victim again told him she wanted to leave but he could not be swayed.
''We are going to die together,'' he said.
As the gas filled the small space, the victim deliberately took shallow breaths.
When her boyfriend began staggering and collapsed on the bed, she saw her chance. But when she tried to leave, her partner grabbed her by the leg and held on.
When the defendant passed out she crawled through a window and sought help.
The campsite manager turned off the gas and moved the car which was blocking the door before police arrived.
Both the defendant and his victim were treated in hospital for breathing difficulties but were discharged the next day.
The defendant was remanded in custody and granted interim name suppression which would be argued in full next month.
He will be sentenced in December. Attempted murder carries a maximum penalty of 14 years' imprisonment.
rob.kidd@odt.co.nz