A Geraldton doctor has been charged with murdering her husband, who was also a doctor, in a domestic dispute.

A DOCTOR accused of murdering her husband says he forced her to perform sex acts while strangers watched online but she loved him regardless.

Chamari Liyanage, 35, is on trial for the June 2014 murder of fellow doctor Dinendra Athukorala, whose body was found covered in blood inside their Geraldton home next to a hammer prosecutors say was used to bludgeon him.

A police officer who was first on the scene described the victim’s lifeless body covered by a pillow with the wooden handle of the mallet on his left hand side.

The trial, in its third and final week, heard on Monday from Dr Liyanage. Under cross-examination in the Western Australia Supreme Court, Dr Liyanage told a jury her husband would direct her to perform sex acts while he live-streamed video online.

She said he was increasingly interested in child pornography websites, subjected her to constant beatings and threatened to throw acid over her and her sister.

ABC News reported Dr Athukorala posted Dr Liyanage’s mobile phone number on an online sex website in Sri Lanka and forced her to do what strangers ordered online.

“It became constant beatings, constant teaching sessions, he kept me sitting on the bed or kept me on camera and (had me) perform for people online,” Dr Liyanage said.

“People would ask me to get undressed or do sexual acts.”

She said she went months without a “peaceful night sleep” and was “exhausted” but never thought about harming her husband.

Asked why she didn’t tell police about the abuse, she replied: “What would I tell them?”

The trial earlier heard from a teenager who shared a sordid relationship with the married couple.

The 19-year-old, who cannot be named, was 17 at the time of the three-way relationship in 2014.

Prosecutors claim Dr Liyanage was fed up with her husband’s sexual demands, which included the couple having sex with other women, and was also concerned about the effect the couple’s relationship with the 17-year-old would have on her career.

“It got to a stage that she was no longer prepared to put up with his behaviour,” prosecutor Nick Cogan said, according to The West Australian.

The teenager told jurors she met the Sri Lankan pair at a dinner party in 2014 and had several encounters with them in their home.

She said the couple was happy and “always smiling and laughing and affectionate”.

The teen said Dr Athukorala always wanted to take photos and videos and on one occasion Dr Liyanage took her shorts off and ran her hand over her underwear under Dr Athukorala’s direction.

“He was watching the whole time, sometimes recording,” the teen said.

The woman said she then had a shower with Dr Liyanage while Dr Athukorala watched and eventually joined the pair.

“I didn’t feel very comfortable after what happened when Chamari touched me, I was confused and naive, I didn’t feel secured,” she said.

She also testified that Dr Liyanage and Dr Athukorala waxed her legs.

“Chamari started waxing my legs and Din helped,” the woman told the court.

“[Dr Athukorala] was in the bedroom. He was holding a video camera. He hugged me from behind and they asked me if I had a boyfriend.”

During the teenage girl’s evidence, Dr Liyanage looked down, sobbed and shook in the dock.

The teenager said in one encounter Dr Athukorala gave her a glass of whisky and wanted to dance, but she woke up the next morning with a bad headache in bed with Dr Liyanage.

She said at one point during the night Dr Athukorala, who knew she was a virgin, was on top of her but his wife tapped him on the shoulder and told him “don’t”.

The teen said at one stage the couple demonstrated sex in front of her. She said Dr Liyanage always obeyed her husband “with a smile”.

Dr Liyanage has pleaded not guilty. The trial is continuing.