"The hostages were released on Sunday," ministry spokesman Col. Didier Badjeck told The Anadolu Agency.
He, however, stopped short from providing further details about the release of the hostages.
"Cameroon army troops are pursuing the attackers who abducted nearly 100 people, including 50 children aging 10 to 15 years," Badjeck said.
A security source told AA that the released hostages were found by Cameroonian troops during their pursuit of Boko Haram militants.
"The 24 people were abandoned by Boko Haram as the militants were fleeing to Nigeria," the source said.
"They [the released hostages] were the weakest, and it is assumed that they were slowing down the attackers as they fled," he added.
On Sunday, nearly 100 villagers were abducted from the village of Mabass, which is located on the border with Nigeria.
According to preliminary evidence gathered by the Cameroonian army, Boko Haram militants had crossed a river between the two countries at dawn on Sunday and attacked villages located along the river, including Mabass.
According to the source, Boko Haram militants set fire to Mabass and stole the livestock there.
The Boko Haram attack came shortly after the arrival Chadian troops in Cameroon to help in the fight against the militant group.
Boko Haram has stepped up attacks in northern Cameroon in recent months, sparking confrontations with the country's military on the border with Nigeria.
Boko Haram, which first emerged in the early 2000s preaching against government misrule and corruption, became violent after the death of its leader in 2009 while in police custody in Nigeria.
The group has been officially outlawed in Nigeria, Turkey and the United States.