A Nebraska mother and teenage daughter are facing criminal charges after the teen allegedly got an illegal abortion and police say the two buried the fetus.

While the abortion allegedly occurred before the U.S. Supreme Court overturned a constitutional right to abortion, a state law on the books since 2010 bans abortions in Nebraska at 20 weeks.

Norfolk police opened an investigation into then 17-year-old Celeste Burgess on April 26, investigating concerns she had given birth prematurely to a stillborn child, according to an affidavit submitted by the Norfolk Police Investigations Unit that was obtained by ABC News.

According to police, Celeste Burgess received help from her mother Jessica Burgess, 41, in taking abortion pills to end the pregnancy and the two allegedly buried and reburied the fetus together three times at different locations.

Celeste Burgess, now 18 and who is being tried as an adult, is facing three charges of felony burying and reburying the fetus unlawfully, and misdemeanor concealing the death of another person and lying to police, according to court records. She pleaded not guilty to the charges, court records show.

Jessica Burgess, 41, is facing five charges of felony burying and reburying the fetus unlawfully, inducing an abortion and performing an abortion without being a licensed physician and misdemeanor concealing the death of another person and lying to police, court records show. She pleaded not guilty to the charges, court records show.

Attorneys listed for both defendants did not immediately respond to ABC News’ requests for comment.

Two of the felony charges against the mother were brought after investigators were able to obtain records of messages between the mother and daughter on Facebook, according to court records.

Medical records obtained by police showed that Celeste Burgess was estimated to be 23 weeks and 2 days at the time of the alleged abortion. Her due date was July 3, according to the affidavit.

In an interview with police, the mother and daughter allegedly said that Celeste Burgess unexpectedly gave birth at home in a bathtub/shower, and said the fetus was stillborn, according to the affidavit.

Celeste Burgess then placed the body of the fetus into a bag, and then placed the bag into a box in the back of a cargo van on their property. The two then took the body of the fetus and transported it to a property north of Norfolk where they buried it, according to the affidavit.

The two voluntarily took police to the scene on April 29 and showed McBride where the body was buried. According to Tanner Barnhill, who helped the two bury the body, the mother and daughter attempted to burn the body of the fetus before it was buried, the affidavit said.

Barnhill, 22, has pleaded no contest to a misdemeanor in connection with the case and will be sentenced later this month, according to the Lincoln Journal Star.

During her interview with police, Celeste Burgess showed police a Facebook message that indicated the birth occurred on April 22, which investigators used in part to get a search warrant ordering Facebook’s parent company Meta to turn over messages between the mother and daughter.

According to court filings which show messages between the two on April 20, they discuss “starting it today.” In one message, Jessica Burgess tells Celeste Burgess that one pill stops the hormones then you have to wait 24 hours to take the other. Celeste Burgess said, “Remember we burn the evidence,” in a subsequent message.

A friend of Celeste Burgess also notified police on June 14 that she was with her when she took the first of the two abortion pills meant to cause a miscarriage.

According to court records, an autopsy was conducted of the fetus and an exact cause of death was not determined, but the lungs did not indicate they had ever contained air. Court records also show the fetus had “thermal wounds.”

Meta, Facebook’s parent company, said in a statement Tuesday the company was unaware that the search warrant was for a case involving abortion.

“Court documents indicate that police were at that time investigating the alleged illegal burning and burial of a stillborn infant,” the company said. “The warrants were accompanied by non-disclosure orders, which prevented us from sharing information about them.”

In a letter to the governor, thirty Nebraska state senators are proposing a special session to pass an abortion ban at 12 weeks, but they do not have the support from 33 state legislators needed to do so, according to the governor.