For years, backyard chicken coops have been a growing trend in some suburban, and even urban, neighborhoods. But a new study has found those chickens are subject to a widespread environmental problem that’s commonly found in soil – lead contamination.

Two black chickens and a yellow one scurry around inside a fenced-off area just off the cozy little structure that serves as their coop. They’re not on a farm out in the country somewhere — this is Lori Segall’s backyard in Somerville.

“This is where they lay their eggs. So here's one,” Segall said, pulling an egg from the coop. “I got one earlier today.”

Segall and her husband first got chickens about five years ago for ethical reasons. They said they don’t want their eggs to come from a factory farm somewhere. But the chickens are also nice to have around.

“The black ones, when sunlight hits them they're kind of iridescent. They're quite pretty,” Segall said.

A couple years ago, Segall found out about a study being conducted in and around Boston about lead contamination in backyard chickens and their eggs.

“I was very curious because I hadn't thought of the fact that my chickens, and therefore my eggs, would be contaminated with lead, even though we were very careful about building raised beds for our vegetable plantings,” she said.

Segall has a heightened risk of being effected by lead.

“I have osteoporosis. So eating things with lead is a bad idea,” she explained. “It's a bad idea for anybody, but particularly for young children with developing brains and for people like myself who have osteoporosis.”

So she agreed to have her soil, chickens, and eggs tested for lead as part of a study that was conducted by researchers at Boston University and the Cummings School of Veterinary Medicine at Tufts University. It was published last month in the journal Environmental Research.

“There is lead in the soil in the Boston area predominantly because we used to have lead in our paint in our houses and many of us still do, if you have a home that was built before the early '80s,” said Jessica Leibler, one of the BU scientists. “There is likely still some lead in the paint in your house in some capacity.”

Chickens tend to have close contact with that contaminated soil.

“They walk around, they roost. They peck. Some chickens really like to peck at paint,” Leibler said.

The researchers wanted to see if that could result in lead exposure in humans through eggs. They got 50 households raising chickens to volunteer for the study. A few were in Dorchester and Jamaica Plain, but they were mostly in suburbs like Somerville, Newton, Concord, Winchester and Beverly.

“Of the 200 eggs that we sampled from the 50 households, we found almost all of them, 98 percent of them, had detectable levels of lead,” Leibler says.

That was even more widespread contamination than Leibler expected. She says the levels in eggs were probably not high enough to cause lead poisoning by themselves.

“However there is increasing evidence over the last 10 years that show that lead levels at significantly lower levels than that can have negative health impacts on children's neurological development,” she added.

Marieke Rosenbaum of Tufts’ vet school was a co-author of the paper. She said the participants in their study tended to be higher-income suburbanites, but there are likely more families quietly raising chickens in more urban settings, especially in immigrant communities from cultures where raising chickens is more common.

“So I think there is a potential for it to be more relevant to minority populations, especially in light of the fact that they're at higher risk for living in an area that has more contamination,” Rosenbaum said.

Rosenbaum says even if you’re not raising chickens, it’s important to understand the kind of contamination that we’ve managed to create in our own backyards. But despite the concerns, she stressed that the message of their study is not that you shouldn’t raise chickens.

“So I actually grew up with backyard chickens in Jamaica Plain, so I'm a huge proponent of backyard chicken ownership, and I think that it's a wonderful activity that can be done in a really safe way,” she said.

To do it safely, she said, you first need to check your soil for lead. And if it’s found, replace that soil. That’s what Segall did when the results came back showing her eggs were contaminated.

“So we got rid of those chickens, dug out all the soil here and got a load of soil dumped in the driveway,” Segall said.

Now, the chickens are pecking away at cleaner dirt. And when the researchers tested their eggs again, the lead levels hadn’t disappeared entirely, but they had gone down a lot.

“You know, what are you going to do?” Segall said, adding that she’d still rather eat eggs with just a tiny bit of lead in them than from factory farmed chickens that aren’t as happy as these ones.