The state Department of Education recently donated thousands of cases of out-of-date food from the school lunch program to state prisons and a county jail, documents show.

The food — more than 11,000 cases of cheese, blueberries, frozen chicken, and other goods — was offered free of charge to kitchens that serve inmates, as education officials removed old products from warehouses that serve schools across Massachusetts. The state had been reviewing its inventory after controversy erupted last month when expired food was discovered in Boston school cafeterias.

The donations to prison facilities, shown in documents obtained by the Globe under the state’s public records law, underscore the breadth of the problem with out-of-date food in the federal school lunch program.

Prison officials defended their cafeterias, while an inmate advocate shuddered at the notion that food unfit for children could be served in jail.

US Department of Agriculture guidelines say that food properly stored or frozen can remain safe after expiration dates, but it loses nutritional value and taste.

The bulk of the old food went to state prisons in Bridgewater, the documents show. A spokeswoman for the state Department of Correction said yesterday that most of the food, including nearly 2,000 cases of cheddar cheese, was thrown out.

Prisons rejected other out-of-date food and refused to pick up the items — including 481 cases of frozen chicken and six cases of frozen beef patties — from the warehouses, said Diane Wiffin, director of public affairs.

A spokesman for the Hampden County Sheriff’s Department said yesterday that it had been longstanding practice to serve food in that jail from the school lunch program that was beyond its best-if-eaten-by date, but not rotten. Hampden County jail, which houses about 1,600 inmates, accepted 700 cases of white cheddar cheese last Thursday that had best-by dates of Dec. 10, 2010, and March 14, 2011, the documents show.

“It’s been a good way to serve good food very frugally in terms of the budget,’’ said spokesman Richard McCarthy, relaying a conversation he had yesterday with the jail’s food-service director. “It’s not rancid food. It’s not spoiled food.’’

But Leslie Walker, executive director of Prisoners’ Legal Services, chafed at the use by jails and prisons of out-of-date food that may be lacking in nutritional value, when many inmates do not have other sources of nourishment.

“I think it’s disgusting,’’ said Walker. “My clients are all too aware that they are on the bottom of the pecking order, but to get food that is unfit for schoolchildren to consume should make it unfit for any human being to consume.’’