The woman, 28, who has been arrested on five counts of manslaughter, made a "comprehensive confession" to the killings after turning herself in as a six-year investigation closed in on her, said Ulrike Stahlmann-Liebelt, the head prosecutor in Flensburg, on Germany's border with Denmark.
Stahlmann-Liebelt said the woman, whose name was not released in accordance with German privacy laws, has two living children, aged 8 and 10. But then in 2006 she began hiding her pregnancies, staying away from doctors and hospitals and killing the infants after giving birth to two at home and three in the woods, she said.
"She had the impression her husband would leave her if she had any more children, and that's why she didn't tell anyone she was pregnant, including her husband," Stahlmann-Liebelt said.
"She has said that the family lived at a certain level of prosperity, that it was clear her husband did not want any more children, and that one reason was to preserve this standard, and she feared that might be endangered if another child were there."
The husband has told police that he knew nothing about the pregnancies, Stahlmann-Liebelt said, and it wasn't entirely clear how the woman managed to keep them secret.
Stahlmann-Liebelt said there have been other cases when woman's pregnancy can go unnoticed by their partners and others.
Police found the first infant's body dumped in a paper sorting station in 2006 about 15 kilometers (nine miles) away from the town of Husum where the woman lived. The second was found in a parking area off a regional highway, also about the same distance from Husum but in a different direction, in 2007.
After reading news reports that DNA results had confirmed the two children had the same parents, the woman then decided not to dispose the other bodies in public places, police official Dirk Czarnetzki said.
She hid the next three infants - whose existence authorities were unaware of until the woman's confession - in boxes in the basement of the building where she lived.
The bodies have now been recovered and autopsies have been carried out, but forensic experts have not yet been able to determine the cause or dates of their death.
Germany has Europe's most widespread network of so-called baby-boxes - hatches usually run by church groups and charities and associated with hospitals where people can give up their newborns entirely anonymously and safely - but Stahlmann-Liebelt said the woman told authorities she did not know how to go about finding one. There are about 100 baby-boxes in Germany - including one in a town about 50 kilometers (30 miles) from the woman's home - and more than 100 babies are estimated to be given up in the country that way each year. While the baby-boxes are technically illegal, authorities turn a blind eye on the practice.
After finding the first two babies, authorities were able to narrow down the likelihood that the parents came from the area around Husum, a town on the North Sea coast.
In the course of the investigation they took hundreds of DNA tests from women in the area over time and took a sample from the woman on Tuesday, Czarnetzki said at a televised news conference in Flensburg, the regional administrative center. A short time after - before the sample had been processed - the woman turned herself in and confessed, he said.
Czarnetzki said the woman's decision to submit to a saliva test and to make a long statement to police suggested "that she felt relieved of great pressure ... simply to be able to say it."
"It's important to stress that, as things stand, our assessment is that no one else was involved and it is apparently the case - incredible as it might seem - that no one noticed the pregnancies or the birth of these children," he said.
A judge has ordered the woman held in custody pending a formal indictment, which typically takes several months in Germany. Stahlmann-Liebelt said it was too early to say what penalty she might face if convicted.
There have been several cases in recent years in Germany of women who have killed several of their own children, though the country's infanticide rate overall is similar to other western European nations.
In the worst case, a woman was convicted of manslaughter in 2006 and sentenced to the maximum 15 years in prison for killing eight of her newborn babies and burying them in flower pots and a fish tank in the garden of her parents' home near the German-Polish border.