Police in South Dakota have finally solved the 38-year-old cold case of an abandoned baby using DNA from genealogy sites to identify the child’s mother.

Theresa (Josten) Bentaas, 57, was arrested Friday in the 1981 homicide of her baby boy.

The Sioux Falls police discovered a full-term baby dead, wrapped in a blanket and abandoned cornfield ditch on Feb. 28, 1981. The cause of death was judged to be exposure to the elements.

MISSISSIPPI MAN KILLED WIFE, FRIENDS AFTER THEY WOULDN’T LET HIM DRIVE DRUNK, POLICE SAY

For decades, no suspect was ever identified but recently Detective Mike Webb, who was assigned to look at the case in 2009, submitted the child’s DNA to NanoLabs, which found two possible matches using the public genealogical database GEDmatch.

“The South Dakota Forensic Lab confirmed through DNA analysis that Theresa (Josten) Bentaas is the baby’s biological mother,” police said in a statement.

CHRIS WATTS SAYS HE KEEPS PICTURES OF PREGNANT WIFE, DAUGHTERS HE KILLED IN PRISON CELL

Police constructed a family tree and performed a "trash pull" to collect beer and water containers and cigarette butts at Bentaas' home. Results from a cheek swab sample show there's "extremely strong evidence" to support a biological relationship between Bentaas and the child, according to the affidavit.

Bentaas told authorities last month that she had hidden her pregnancy from her friends and family and gave birth while alone in her apartment, according to a court affidavit. Bentaas allegedly said she then drove the baby to the area where he was later discovered.

CLICK HERE TO GET THE FOX NEWS APP

“This case would likely have never been solved if it wasn’t for the incredibly hard work and persistence of Detective Mike Webb and the investigators who assisted with this case,” said Chief Matt Burns. “I’m very pleased that after all this time we are able to bring some closure to this.”

Bentaas is charged with first- and second-degree murder and manslaughter in the first degree. She is being held on a $250,000 bond.

The Associated Press contributed to this report.