The eight female students... have escaped from the terrorists' den," Samuel Aruwan, Kaduna state internal affairs commissioner said in a statement late Tuesday.
The students of Government Secondary School Awon in Kachia district were seized on April 3 in the latest abduction of pupils in the region.
Aruwan had initially said 10 students of the school which runs day classes were taken before revising the number to eight.
All the hostages escaped from "a thick forest" on the border between Kaduna and central Niger State and walked for several days before reaching a location where they were given shelter, said Aruwan.
The students were taken for medical checks before being reunited with their families, while soldiers combed the forest for the abductors, he added.
Abductions for ransom and intercommunal attacks have been on the rise again especially in northwest Nigeria after a lull during elections in February and March for the presidency and governorship posts.
Nigeria's government last year branded criminal militia gangs as terrorist organizations in part to facilitate military action against them.