Residents in poor areas of South Africa's capital, Pretoria, have set buses on fire and blocked roads in riots attributed to discontent over the selection of the ruling party's selection of a mayoral candidate.

The South African government on Tuesday condemned the violence and said law enforcement agencies will act against the perpetrators.

The unrest began Monday and has affected several areas of Pretoria, including Mamelodi and Atteridgeville.

Some residents complained that they had not been adequately consulted over the selection of Thoko Didiza, a former Cabinet minister, as mayoral candidate for the African National Congress in local elections on Aug. 3. They want incumbent Kgosientso Ramokgopa to stay, though Ramokgopa has backed Didiza as his replacement, reported the African News Agency, a South Africa-based media outlet.