DETROIT (AP) — The state of Michigan has agreed to destroy more than 3 million dried blood spots taken from babies and kept in storage, a partial settlement in an ongoing lawsuit over consent and privacy in the digital age.

At the state’s direction, hospitals have routinely pricked the heels of newborns to draw blood to check for more than 50 rare diseases. That practice, which is widespread across the U.S., isn’t being challenged. Rather, the dispute is over leftover samples.

A blood spot from each child is stored in Lansing while five more are sent to the Michigan Neonatal Biobank in Detroit for safekeeping under climate-controlled conditions.

Scientists can pay a fee to use the Detroit-stored samples for various research projects. Research with newborn blood spots occurs in other states, too, especially California, New York and Minnesota where they can be kept for decades.

Texas in 2009 agreed to destroy millions of spots to settle a lawsuit over privacy.

Since 2010, Michigan must have permission from parents to use spots for research. But attorney Philip Ellison argues that the program still violates constitutional protections against searches and seizures and might not be fully understood by parents who are presented with forms amid the fog of childbirth.

In the months ahead, Ludington will hold a trial to try to determine how many blood spots really are needed for newborn disease screening, including to calibrate critical testing equipment, among other issues.

The health department is defending how it runs the program. It emphasizes that no spots are stored for research unless parents or guardians give permission. Spots also can be destroyed upon request, though the number of people who take that step each year is very small.

A code — not someone’s name — is attached to blood spots that are stored in Detroit, making privacy risk during research “very low,” the state said.

“We only allow activities which pertain to public health for benefit of all, for public good, for getting better testing in the future, for discovering more and so on,” Sandip Shah, director of the state’s public health laboratory, said in an interview with lawyers.

The department publishes a list of approved research. The state last year, for example, signed off on scientists using 3,600 newborn blood spots to determine exposure to so-called forever chemicals known as PFAS in western Michigan. Other projects have involved for-profit companies.

“How this court resolves the issues presented by plaintiffs could dramatically impact the biomedical research environment, potentially chilling scientific progress critical to protecting public health,” the Association of Public Health Laboratories said.

In 2009, Texas agreed to destroy millions of newborn blood spots that were kept without consent. Spots obtained since 2012 now are destroyed after two years unless Texas parents agree to have them stored longer for research.