The remaining passengers taken hostage in March after gunmen bombed and attacked a train in northwest Nigeria have been freed, government and security officials said on Wednesday.
Gunmen blew up the tracks and attacked the train traveling between the capital, Abuja, and Kaduna, killing eight people and kidnapping dozens in one of the most high-profile attacks this year.
"All 23 kidnapped victims of the ill-fated Kaduna train mishap released," Transport Minister Mu'azu Jaji Sambo said on Twitter.
A team had secured the release and took custody of passengers "held hostage by Boko Haram terrorists following the attack on the Abuja to Kaduna train," a statement from a military committee said, without giving details on how they were freed.
Kaduna state security commissioner Samuel Aruwan confirmed the hostage release.
Security is a major concern for Nigerians as the country prepares for February elections to replace President Muhammadu Buhari, a former army general who is stepping down after two terms leading Africa's most populous country.
No group claimed the March 28 train attack, though officials have blamed jihadis cooperating with heavily armed criminal gangs who terrorize parts of northwest and central Nigeria with looting raids and mass abductions.
Analysts said the sophisticated attack involving explosives indicate Islamist militants could have participated.
Nigerian government officials often use the term Boko Haram loosely to refer generally to armed groups.
After halting the high-speed train, the gunmen opened fire on coaches before herding passengers from the train's so-called VIP section into the bush.
A week later, they freed one hostage, a top bank executive, as a goodwill gesture for the Muslim Holy month of Ramadan.
Groups of other train hostages had been released after negotiations earlier in the year.
The Kaduna train attack was one of several major incidents this year underscoring the challenge facing Nigeria's overstretched security forces.
Officials have become increasingly concerned that militants are cooperating for pragmatic reasons with criminal bandit gangs in the northwest, who are motivated by profit rather than ideology.
Nigeria's military is battling on multiple fronts: a 13-year jihadi insurgency in the northeast, criminal militias in the northwest and separatist tensions in the country's southeast.