US forces and members of the Fifth Iraqi Army came upon "an al-Qaeda in Iraq prison camp" south of the provincial capital, Baquba, Lieutenant-Colonel Michael Donnelly, said.
"As we came upon this thing, we had the captors or whoever was holding them flee the scene. We immediately secured the area and got the prisoners or those that we rescued to safety," he added.
He said the group was the largest number of captives found in a single al-Qaeda prison.
The US military added that the freed men had been taken to a nearby combat outpost, where they had been given food and water.
Baquba is part of a belt of violent towns around Baghdad where Sunni fighters, Shia militias and security forces are locked in a vicious three-way battle.
Thousands of US troop reinforcements have flooded into Diyala as part of the broader so-called "surge" strategy to quell fighting in the Baghdad region.
Meanwhile, 10 more US servicemen have been killed across Iraq in a series of incidents, the military reported on Sunday.
The spike in casualties comes amid an increase in the number of troops meant to restore stability in Baghdad but which has also exposed them to greater losses.
Since Friday the US military has reported the deaths of at least 19 soldiers, bringing the number killed to 3,455 since the March 2003 invasion of Iraq.
One US soldier was killed and another four wounded when a roadside bomb blew up near their patrol in western Baghdad on Saturday, and another soldier was killed and two wounded in a similar blast northeast of the capital.
Three soldiers were killed when a roadside bomb exploded next to their vehicle in the mainly Sunni Muslim province of Salaheddin on Saturday.
Two others were wounded. Another explosion on Saturday in southern Baghdad killed a soldier and wounded two others.
Their unit had been searching for weapons caches and detaining suspects.
In western al-Anbar province a marine was killed in combat. A complex attack involving explosives and small arms fire killed another soldier late on Friday north of the capital near Taji.
Three others were wounded in the attack.