More than 300 schoolboys have been reunited with their families, a week after they were kidnapped from their school in north-west Nigeria.
The boys arrived by bus in Katsina, capital of the state of the same name, where they were met by President Muhammadu Buhari.
Looking weary, some were still wearing their school uniforms, while others clutched grey blankets.
State authorities now say the children were abducted by local bandits.
Jihadist militant group Boko Haram had claimed to have been behind the mass kidnapping but some experts were sceptical because it occurred well outside their normal area of operations.
According to Governor Aminu Bello Masari, 344 boys were freed but others remain missing.
They were abducted on 11 December in an attack on a school in the town of Kankara.
How were the boys greeted?
Flanked by armed police, the boys walked in single file from the buses to a government building to meet President Buhari and the governor. They were also due to undergo medical checks.
Parents were overjoyed to be reunited with their sons. "I couldn't believe what I heard until neighbours came to inform me that it's true," one mother told Reuters news agency.
"I'm so excited," said another mother who been waiting anxiously with other parents after seeing her boy, 15. "I have to cry, the cry of joy when I saw him," she told AFP news agency.
One boy told a TV station the group had been fed bread and cassava during their captivity and that it had been cold. He said he was "really happy" to be back in Katsina.
Addressing the freed children, Governor Masari said: "You suffered physically, mentally and psychologically, but let me assure you that we suffered more and your parents suffered more."
Earlier he had told media: "I think we have recovered most of the boys- it's not all of them."
How was the release secured?
The government insists no ransom was paid but that the boys were released after negotiations with the kidnappers.
Zamfara state governor Bello Matawalle, in whose state the boys were released, told the BBC that three separate negotiations had taken place before the students' freedom was secured.
They were released in Tsafe town in Zamfara on Thursday evening, authorities say.
Mr Matawalle told BBC Hausa that during the negotiations the kidnappers had raised various grievances.
"Among their complaints was how people kill their cattle and how various vigilante units disturb them," the governor said, adding that the government had promised to look into the complaints of the kidnappers.
Conflict between herders and farming communities are common in Nigeria's central and north-western states, says the BBC's Nduka Orjinmo in Lagos.
Both groups have been warring for decades but deadly clashes have increased in recent years as farming communities and herdsmen have employed armed vigilantes, especially in Nigeria's north-west.
A spokesman for Governor Masari, Abdul Labaran, told the BBC the boys had been held by bandits.
"It wasn't Boko Haram," he said. "The local bandits we know about all along were responsible. These are people we know very well, I met some of their leaders. That is why an umbrella body of cattle breeders' association was used in contacting them. So the negotiation was made through this umbrella body of cattle breeders."
How did the school attack unfold?
Witnesses say armed men raided the school in Kankara last Friday evening. Many students jumped the school fence and fled when they heard gunshots.
Some were tracked by the gunmen, who tricked them into believing that they were security personnel, students who escaped said. Once these students were rounded up, they were marched into the nearby forest by the armed men.
On Thursday, video was released bearing Boko Haram's emblem, showing dozens of boys, some of whom appeared to be very young.
One of the boys said they had been taken captive by "the gang of Abu Shekau". Abubakar Shekau leads Boko Haram, a group notorious for school kidnappings, including one in Chibok in 2014, when nearly 300 schoolgirls were seized.
The name of the group, which is based in north-east Nigeria, loosely translates as "Western education is forbidden".
Armed attacks and kidnappings are rife in the north-west and are often blamed on bandits, a loose term for gangs operating in the area.
Amnesty International says more than 1,100 people were killed by bandits in the first six months of this year, with the government failing to bring the attackers to justice.