A South Dakota woman was charged Friday in the death of a newborn who was abandoned in a ditch 38 years ago, and police said they used DNA and genealogy sites to determine she was the baby's mother.

Theresa Rose Bentaas was arrested and charged with murder and manslaughter in the 1981 death of the infant, known as Baby Andrew.

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 he was later discovered, a cornfield ditch in Sioux Falls.

Bentaas, now 57, said she was "young and stupid" and felt sad and scared as she drove away, according to the document. The baby died of exposure.

Bentaas, who was 19 when the baby died, later married the infant's father and has two living adult children with him, the Argus Leader reported.

Court records don't list an attorney for Bentaas who could comment on the allegations.

The case has gripped Sioux Falls for decades. Roughly 50 people attended the child's funeral, held more than a week after he was discovered. Children left stuffed animals and a pin on his pajamas read: "You are loved."

Retired Detective Mike Webb said authorities used DNA from the baby exhumed 10 years ago and DNA obtained from Bentaas through a search warrant. Webb said the father won't be charged because he wasn't involved.

"I couldn't be more pleased with the results today and the arrest and the closure that we find, as well as the hard work and dedication for the pursuit of justice for Andrew," Chief Matt Burns said.

Public genealogy databases have been used in other recent cases, including the capture last April of the suspected Golden State Killer in northern California and the arrest of a businessman accused of fatally stabbing a Minneapolis woman in 1993.

In South Dakota, authorities submitted a DNA sample from Baby Andrew to Parabon NanoLabs, which found two possible matches using the public genealogical database GEDmatch. 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.