The arrests were a new development for South Africa, which has a small Muslim population and has not been known to be a hub of Islamic State activity. “There were cases where we’ve stopped people from traveling to Syria before, but in terms of an arrest, this is the first time,” Mr. Mulaudzi said.

The brothers, Brandon-Lee Thulsie and Tony-Lee Thulsie, 23, appeared on Monday in Johannesburg Central Magistrate’s Court, where they were charged with “conspiracy and incitement to commit the crime of terrorism.” According to the charges, the brothers had acted since last October to “further the political, religious or ideological motives and objectives” of the Islamic State.

The brothers are scheduled to appear again in court on July 19, when more details could emerge about how far they had carried out their plans.

Martin A. Ewi, a terrorism expert at the Institute for Security Studies in Pretoria, said that the arrests possibly signaled a change in policy by the South African government. Until now, he said, the authorities had quietly tried to handle cases involving South Africans who tried to go to Syria, or even some who had gone and returned.

“The government didn’t want to antagonize certain segments of South African society, so once they knew about you, you were warned and monitored and told to reintegrate yourself, and there were no cases of repeat behavior that we know of,” Mr. Ewi said. “But maybe they now feel that the situation is getting out of hand, or they may have had no alternative because the suspects didn’t change their behavior even though they were under surveillance since last year.”