South Africans, including President Jacob Zuma, expressed grief and anger on Monday after the death of the national soccer team’s captain, Senzo Meyiwa, in a robbery attempt that ended in a shooting at a township near Johannesburg.

“The whole country is crying,” Dennis Mumble, a top South African soccer official, said in a statement.

After months of hearings in the trial of the South African track star Oscar Pistorius, who was sent to prison last week for shooting his girlfriend, Reeva Steenkamp, the death of Mr. Meyiwa, a commanding presence as goalkeeper in both the national squad and his own team, the Orlando Pirates, showed once again the prevalence of gun violence in the nation.

It also seemed to reinforce the perception that, while the death of Ms. Steenkamp, 29, and the trial of Mr. Pistorius, 27, generated enormous global news media attention, many more people die far from the spotlight, often in once-segregated townships such as Vosloorus, where Mr. Meyiwa died.