Prachanda, who heads the Unified CPN-Maoist, was elected from a seat in Siraha in southern Nepal by a margin of just 900 votes. He secured 15,244 votes to defeat his nearest rival Lila Shrestha of CPN-UML.
Apart from his own defeat in another constituency in Kathmandu, where he finished third, Prachanda suffered major blows as his daughter Renu Dahal, cousin Narayan Dahal and daughter-in-law Bina Magar lost the race to enter the 601-member assembly that will draft Nepal's new Constitution.
Bina Magar was defeated in a constituency in Kanhanpur by CPN-UML candidate Lal Bahadur B K. Narayan Dahal lost the election from a Chitawan constituency to CPN-UML candidate Krishna Bhakta Pokharel.
With Maoists headed for a rout in the polls, people did not celebrate Prachanda's victory in Siraha district.
More From This Section
The UCPN-Maoist party has suffered big losses and was running a distant third behind the Nepali Congress and CPN-UML, according to official results.
The Maoists are threatening to boycott the assembly, alleging a conspiracy.
The vote was only the second one since a civil war launched by Maoist rebels ended in 2006. Nepal was then transformed into a secular republic.