The operator of New England’s largest egg-producing farm, located in Turner, said Friday it will convert its operation to cage-free, but only as its farms are expanded or older facilities are replaced.

Hillandale Farm said that, in any expansion, it will convert to facilities where egg-laying chickens are no longer confined to cages, a practice that animal rights groups have labeled as cruel.

The Turner farm, which has about 4 million egg-laying hens and supplies eggs for much of the region, was the subject of a Humane Society of the United States undercover operation last month. The animal rights group alleged that hens were kept in cages that were so small the birds couldn’t spread their wings and were sometimes trapped by their necks, wings and feet. The organization also alleged that chickens were sometimes kept in cages alongside dead and decaying chickens.

The Maine Department of Agriculture, Conservation and Forestry is conducting an investigation.

Hillandale is headquartered in Pennsylvania and operates egg farms there and in Maine, Iowa and Connecticut.

In a statement, the company said it is building two new cage-free chicken houses in Ohio and Connecticut. The facility in Hicksville, Ohio, is expected to be completed in the third quarter of 2017, the company said, and the one in Bozrah, Connecticut, will be done shortly thereafter.

“All future expansion at any of our farms will only be with chickens housed in a cage-free environment,” Gary Bethel, chief executive of Hillandale Farms, said in the statement. “As our existing facilities age, they will be replaced with cage-free barns, as well.”

The company also said that its New England and Ohio pullet houses, in which chickens are raised until they are old enough to begin laying eggs, will be cage-free.

Hillandale operates the Turner farm, which is still owned by Jack DeCoster, a Maine businessman with a long history of environmental and labor violations. DeCoster’s egg and hog companies paid millions in fines and damages for faking trucking logs and knowingly hiring illegal workers, and for violations involving environmental contamination, animal cruelty, workplace safety problems and the exploitation of workers. In 2015, he and his son, Peter, were sentenced to three months in jail for their role in a 2010 salmonella outbreak that sickened nearly 2,000 people. They pleaded guilty to selling contaminated eggs from their farms in Iowa and were fined $100,000 each.