On Sunday morning, the militants targeted the villages of Mabass and Makxy in the Mayo-Tsanaga division of Cameroon's Far North Region, razing more than 80 houses and taking captives.
Three of those abducted were later found dead, state-run media reported.
Mijiyawa Bakary, the regional governor, told CNN on Monday that soldiers from the Cameroon army's Mobile Intervention Battalion freed some of the captives during an operation against Boko Haram.
"The 24 people regained their freedom as the soldiers were chasing the Boko Haram militants. The insurgents were fleeing back to Nigeria from whence they came," he said.
Col. Didier Badjeck, a Cameroonian Defense Ministry spokesman, confirmed the captives had been freed.
Communication Minister Issa Tchiroma Bakary said Sunday's mass abduction was the largest that Boko Haram has conducted inside Cameroon.
The deployment followed Cameroonian President Paul Biya's call for international cooperation in the fight against Boko Haram.
Cameroon has already deployed about 7,000 troops across the Far North, where Boko Haram has scaled up attacks over the past six months.
Boko Haram has terrorized northern Nigeria regularly since 2009, attacking police, schools, churches and civilians, and bombing government buildings.
It has also kidnapped students, including more than 200 schoolgirls who were abducted in April -- and remain missing.
The Islamist group has said its aim is to impose a stricter form of Sharia law across Nigeria, which is split between a majority Muslim north and a mostly Christian south.
Initially, Boko Haram militants crossed the border into neighboring Cameroon to steal food or kidnap foreign nationals, but more recently the group has attacked military installations.
While Chad is the first country to put boots on the ground in Cameroon, the international community and regional bodies are also expressing concern.
The U.N. Security Council is expected to condemn Boko Haram by name in a strongly worded statement later Monday.