The five men, two women and a teenager were freed Tuesday in Ghazni province, the National Directorate of Security said in a statement.
The NDS said they were among 31 Hazaras abducted earlier this year, but gave no further details.
A group of 31 Hazaras, believed at the time to be men, were forced off buses in Ghazni in February. Of the abductees, 19 were freed in May and the rest remain unaccounted for.
Senior government officials said at the time that the Islamic State group was behind the abductions. The NDS statement made no comment on who was responsible, referring only to “terrorists.”
Hazaras, who are predominantly Shiite, have been targeted in several large-scale kidnappings this year, prompting demonstrations and sit-ins in the capital Kabul and elsewhere.
The beheaded bodies of seven Hazaras were found in Zabul, neighboring Ghazni, on Saturday. The four men, two women and a child had been kidnapped up to six months ago, officials said.
The NDS dismissed Taliban claims that IS was responsible for the beheadings. Rival Taliban factions have been fighting in the region for days.
The bodies were being transported from Ghazni to Kabul, ahead of a demonstration planned for Wednesday near the presidential palace, according to an organizer, Daud Naji.