At least 24 of up to 80 people taken hostage by Boko Haram militants in Cameroon at the weekend are reported to be free.
Some escaped from their captors while Cameroon said others were freed "as defence forces pursued the attackers who were heading back to Nigeria".
Many of those kidnapped in the cross-border raid were said to be children.
It was one of the biggest abductions by Boko Haram outside Nigeria and raised fears that it is expanding its attacks.
The militant Islamist group has seized control of towns and villages in north-east Nigeria and has begun threatening neighbouring countries.
Chad, which also borders Nigeria, has recently sent soldiers to help Cameroon tackle the militants.
The abductions took place in the villages of Maki and Mada near the city of Mokolo in Cameroon's Far North region.
Cameroonian police and officials said the militants had arrived early on Sunday when it was still dark. Many of those seized were said to be women and children.
Before leaving, the attackers burned dozens of homes to the ground.
The Cameroonian army pursued the group towards the Nigerian border, eventually engaging the militants in a gun battle.
Local officials and the Cameroonian military said some of the hostages had managed to escape from their captors. Others were freed during and after the fighting.
The militants used some of the hostages as human shields, AP news agency quoted the Cameroonian military spokesman as saying.
There has been no word on any casualties in the clash.
On Friday, Ghana's President John Mahama said African leaders would discuss plans this week to "deal permanently" with Boko Haram, and suggested a multinational force may be considered.
Niger and Cameroon have criticised Nigeria for failing to do more to stop Boko Haram's attacks.
Correspondents say Nigerian politicians appear more focused on campaigning for elections next month than on security issues, and senior figures rarely comment on the insurgency in the north-east.
Boko Haram at a glance
- Founded in 2002
- Initially focused on opposing Western education - Boko Haram means "Western education is forbidden" in the Hausa language
- Launched military operations in 2009 to create Islamic state
- Thousands killed, mostly in north-eastern Nigeria - also attacked police and UN headquarters in capital, Abuja
The abductions in Cameroon came just days after the country's army said it had killed 143 Boko Haram militants who had attacked one of its bases at Kolofata near the Nigerian border.
That was the first major attack on Cameroon since Boko Haram threatened the country's leader in a video posted online earlier this month.