Some of the hostages said they had been kidnapped some 30 years ago. The defence ministry said 26 of them were children, some of whom were born in captivity.
The hostages said they were also forced to work in fields.
Some 120 Peruvian soldiers took part in the operation, after being taken to the farm by former rebels.
Four army helicopters were used to airlift the hostages into safety.