CAIRO — The public prosecutor on Monday ordered the arrest of five anti-Islamist political activists on charges of using social media to incite violence against the Muslim Brotherhood. The order stirred accusations of a vendetta by the group’s close ally, President Mohamed Morsi.

Egyptians are already on guard against the possibility that their first freely elected president may seek to become a new autocrat, and some said they feared that the arrest warrants might be the first clear example that Mr. Morsi’s government was using law enforcement as a political tool to punish his critics.

A search of the online comments by several defendants found no messages urging others to violence. Some, in fact, argued strongly against it.

But the arrests arose out of an attack by anti-Islamist activists on the Muslim Brotherhood’s headquarters in Cairo on Friday night. As many as a thousand of the group’s opponents arrived armed with sticks, knives and at least a few guns, and they seemed intent on burning down the headquarters.