A mother embroiled in a custody battle shot and killed her two children before taking her own life in Gresham, Oregon, police say.

Ashley Palmer gunned down her two young children, 6-year-old Kayleana Beatrice Palmer and 8-year-old Xavier Rayvaughn Danger Palmer, then shot herself dead at the Rockwood Apartments near Southeast 185th and Yamhill, according to police.

Officers were doing a welfare check at the home early Tuesday, May 10,  when they discovered the mother and children dead inside. On Wednesday, police began calling the incident a murder-suicide.

Ashley and her spouse, Jenavie Palmer, had separated two years ago and the couple were in the middle of a "pretty bad" custody dispute.

"We were in the middle of trial and the children were going back and forth between our houses," Jenavie, told The Oregonian.

Jenavie said Ashley send her a disturbing text just hours before the gruesome discovery. The message included a YouTube link to a music playlist with the words "mother children murder suicide 2022," the outlet reported.

She called 911 and cops responded to the apartment, but they were unable to get inside.Police then told her to wait until the morning to check on the children, Jenavie told the outlet.

According to court records. Ashley had claimed twice in court that her children faced imminent harm if Jenavie Palmer was allowed partial custody.

"Every time that (Ashley Palmer) has not gotten her way, she has petitioned the court for an immediate danger order," Erin O’Riley,Jenavie’s lawyer for Palmer, wrote in the filing.

A Gofundme account has been started to help pay for the children’s funeral costs.

"It’s so challenging and so hard to believe that someone could get to that point of desperation, loss and unfathomable grief and feeling like this was their only avenue of escape or only avenue of overcoming whatever was haunting them," said Multnomah County Behavioral Health Crisis Services Manager Barbara Snow.

"Usually it’s a case of just such feelings of hopelessness and helplessness that the idea of reaching out doesn’t feel like a realistic idea to that person," Snow. added.

police-2167968_960_720 Representation Image Crime Scene police tape geralt/Pixabay