The marchers were ethnic Hazaras demanding that a major regional electric power line be routed through their impoverished home province. Most Hazaras are Shiite Muslims but most Afghans are Sunni.
Footage on Afghan television and photographs posted on social media showed a scene of carnage, with numerous bodies and body parts spread across the square.
Islamic State group's Aamaq news agency has claimed responsibility for the deadly bombing.
Angry demonstrations sealed some of the area around the square, and prevented police and other security forces from entering. Some threw stones at security forces.