Hundreds of Nigerian schoolgirls abducted from a boarding school in the country’s northwest last week have been released, officials said Tuesday.

Zamfara state governor Bello Matawalle said that all 279 students taken Friday morning from Government Girls Junior Secondary School in the town of Jangebe were freed.

In messages posted to Twitter, Matawalle shared images of the girls as they travels in vans to the state capitol, Gusau. He called on “all well-meaning Nigerians to rejoice with us as our daughters are now safe.”

“This news bring overwhelming joy,” Nigerian President Muhammadu Buhari wrote on Twitter. “I am pleased that their ordeal has come to a happy end without any incident.”

Though local authorities initially said that 317 girls had been abducted, the number came down as some girls were found to have eluded capture by fleeing the school.

Photographs from Gusau showed dozens of young girls speaking with officials. Matawalle said at a news conference that the girls would receive medical examinations before being returned to their families.

The kidnapping of the students in Zamfara in early Friday came amid a spate of similar abductions over recent weeks, including one just nine days before, when attackers stormed a boarding school in north-central Nigeria and took more than 40 people.

The targeting of schoolchildren by Nigerian extremist groups has been a threat for years, but some analysts say the problem is worsening. Boko Haram achieved international notoriety for kidnapping more than 270 schoolgirls from the town of Chibok in the northeastern state of Borno in 2014.

Though some girls were later released after a global social media campaign centered on the hashtag #BringBackOurGirls, more than 100 are still missing.

Most of the kidnappers, usually dubbed “bandits” by officials, target children in the hope of extracting ransoms. Between 2011 and 2020, Nigerians paid at least $18 million in response to such demands, according to a report by consulting firm SB Morgen.

Nigerian officials did not provide a detailed account of how the Zamfara students had been freed. Speaking at a news conference on Tuesday, Matawalle suggested the government had worked in some way with “repentant bandits.”

“Those repentant ones are working for us, and they are working for the government, and they are working for security,” the governor said, Reuters reported.

In his Twitter messages, the Nigerian president pledged to do more to fight kidnappings.

“We are working hard to bring an end to these grim and heartbreaking incidents of kidnapping,” Buhari wrote, calling on local communities to provide “human intelligence that can help nip criminal plans in the bud.”

Peter Hawkins, UNICEF’s representative in Nigeria, said that while the organization was relieved the girls had been returned, the Nigerian government must do more to protect places of learning.

“While we rejoice at the release of the schoolgirls and look forward to their safe return to their families, we reiterate that attacks on students and schools are not only reprehensible but a violation of the right of children to an education,” Hawkins said. “It is a right that any society can ill-afford to violate.”