Tens of thousands of South Africans demonstrated peacefully on Friday in a national outpouring of anger at their scandal-tainted President, while a second agency lowered the country’s credit rating to junk status a week after the firing of the respected finance minister.

While concerns grew about the struggling economy and government corruption, the protests were unlikely to pose an immediate threat to President Jacob Zuma, who retains the backing of powerful factions within the ruling African National Congress party. But divisions over his conduct are growing within the party, whose moral authority a legacy of its leading role in the fight against white minority rulehas eroded during his tenure.

Nobel laureate and anti-apartheid leader Desmond Tutu (85) and ailing, made a rare public appearance to support the protests. His foundation posted a scathing tweet in his name- “We will pray for the downfall of a government that misrepresents us.”

In Johannesburg, police fired rubber bullets to disperse about 100 ruling party members who were making their way toward protesters, the African News Agency reported. Separately, ruling party members assaulted several protesters participating in a march organized by the Democratic Alliance, South Africa’s biggest opposition group. Other ANC members in military uniforms who had been posted outside their party headquarters helped to escort the protesters to safety.

Police in Pietermaritzburg city also fired rubber bullets to keep Zuma supporters away from a rally against him.

The Fitch agency cited political uncertainty as a factor in its decision to downgrade South Africa’s credit rating to below investment grade, days after Standard & Poor’s did the same.

Zuma’s Cabinet reshuffle, in which Finance Minister Pravin Gordhan was fired, will further discourage companies from investing in South Africa and could weaken “standards of governance and public finances,” Fitch said.

The government appealed for calm and said it respected the right to protest peacefully. The country turned to democracy after white minority rule ended in 1994 with the country’s first all-race vote and the election of Nelson Mandela as President.

In some cities, protesters with banners lined stretches of road or stood on overpasses; passing cars honked their horns. In the capital, Pretoria, they marched to the Union Buildings, which houses the offices of Zuma and other government officials. In Cape Town, motorcyclists with South African flags led a rally.

“Fire Zuma,” read some placards.

South African media outlets posted photos of Mr. Tutu and his wife, Leah, standing with residents at a bus shelter outside the retirement home where they are staying in Hermanus, near Cape Town. Mr. Tutu was shown smiling and raising a walking stick, apparently to acknowledge passing protesters.

The retired Anglican archbishop, who was awarded the Nobel Peace Prize in 1984 for his peaceful campaign against apartheid, has criticized the ANC for alleged mismanagement over the years. He has been hospitalized several times since 2015 because of infections linked to past treatment for prostate cancer.

Mr. Gordhan, the former finance minister, was seen as a counter to the alleged influence of the Gupta family, Indian immigrant businessmen who have been accused of trying to influence some of Zuma’s Cabinet picks for their own financial gain. The Guptas deny any wrongdoing, and Mr. Zuma has said there was nothing improper in the way he chose ministers.

Mr. Zuma and the ruling party, which suffered big losses in municipal elections last year, have been weakened by other scandals around the president. Mr. Zuma was forced to reimburse some state money after the Constitutional Court ruled against him last year in a dispute over millions of dollars spent on his private home.