Dozens of schoolgirls from the northern Nigerian community of Dapchi were returned early Wednesday morning, dropped off by the same Boko Haram militants who kidnapped them more than a month ago.

The surprising turn of events was greeted with joy from parents whose daughters were safely returned, but the relief was tempered by suspicions that several girls had died, possibly of thirst, while in the hands of the militants. Some are apparently still being held.

Jauro Usman, a resident of Dapchi who is close to many of the parents of the kidnapped girls, said those who had been reunited were “very, very happy.”

“Boko Haram came themselves and dropped our daughters,” he said.

A photograph taken by another resident of Dapchi showed heavily armed, masked militants arriving on Wednesday in a truck crammed with girls, a black flag waving from the vehicle as onlookers raised their hands. After dropping off the captives, the militants offered a stern warning to parents, threatening to return if the girls went back to school.

Government officials said that at least 76 of the girls had been returned but that the total number of freed students was still being tallied. The girls were released at about 3 a.m. on Wednesday “through back-channel efforts and with the help of some friends of the country,” according to a statement from Lai Mohammed, Nigeria’s information minister. The return of the schoolgirls was “unconditional,” the statement said.