“It didn’t make a whole lot of sense to us,” she said. “It’s not like babies are hanging out in the vagina. They come shooting out pretty fast.” Also, she said, they emerge covered in a waxy substance called vernix, which most likely helps keep bacteria from latching on.

The researchers wondered if babies might acquire some of their intestinal bacteria before birth, maybe from the placenta.

So they collected placentas in the delivery room from 320 women, mostly black and Hispanic. Most had vaginal deliveries, and some had cesareans. Most of the births were at term, but some were premature.

The scientists searched the placental tissue for bacterial DNA, using a technique called shotgun metagenomic sequencing. They shaved off the outer layer of each placenta and tested samples from the inside, to avoid surface contamination.

“The placenta is not teeming with bacteria, but we can find them, and we can find them without looking too hard,” Dr. Aagaard said.

She said the placenta was less than 10 percent bacteria by mass, comparable to the eye or deeper regions of the skin, but very different from the intestine, which is 90 percent bacteria.

The study provides an “initial snapshot” of the placental microbiome, Dr. Aagaard said. About 300 different types of bacteria turned up, most of them harmless. The team compared the distribution of the types with what had been found previously in other parts of the body, including the mouth, skin, nose, vagina and gut. The closest match by far was between the placenta and the mouth, which, in turn, was much like that in babies’ intestines in the first week of life.