https://60ribo.org.il/the-chafetz-chaim-hated-russian-communist-leaders/
It was told in the biography of Rabbi Elchanan Wasserman (in the English Artscroll edition, page 59) what the Chafetz Chaim (who usually has the final say on what is Jewish Law) did to the Communist, Trotsky.
That the Chafetz Chaim agreed to curse this wicked man with a curse , special for wicked Jews and within a short time thereafter, Trotsky fell from power (one should add that after a few years later , Stalin also murdered him). And see also the Be’ur Halacha, siman 329 the words beginning with Eleh L-fi ”that it is permissible to curse a wicked Jew”….for it is written ” and a leader of your nation do not curse” -when he does the action of your nation.
“But if he is standing in a place that has Apikorsim (heretics) that rise up against the Torah and wish to enact some regulations in the matters of the city, and by means of this they will bring the people to transgress the will of G-d; and he opened in peace, and his words were not obeyed. In such a situation the Beit Yosef did not speak of at all. And it is a mitzvah to hate them and quarrel with them and nullify their plotting with all that he has the ability to do. And King David, peace be unto him said, ”Do I not hate, Hashem, those that hate you and with those that rise up against you , I shall quarrel ! I hate them with an utmost hatred: I count them as my enemies”. (Psalms 139:21,22)"
However the story is not likely true
Berachos (7a)A certain heretic who was in Rabbi Yehoshua ben Levi’s neighborhood would upset him by incessantly challenging the legitimacy of verses. One day, Rabbi Yehoshua ben Levi took a rooster and placed it between the legs of the bed upon which he sat and looked at it. He thought: When the moment of God’s anger arrives, I will curse him and be rid of him. When the moment of God’s anger arrived, Rabbi Yehoshua ben Levi slept. When he woke up, he said to himself: Conclude from the fact that I nodded off that it is not proper conduct to do so, to curse people, even if they are wicked. “His mercy is over all His creations” (Psalms 145:9) is written even with regard to sinners.
Moreover, it is inappropriate to cause the punishment of another, as it is written: “Punishment, even for the righteous, is not good” (Proverbs 17:26), even for a righteous person, it is improper to punish another. Berachos (19a)
There were these hooligans in Rabbi Meir’s neighborhood who caused him a great deal of anguish. Rabbi Meir prayed for God to have mercy on them, that they should die. Rabbi Meir’s wife, Berurya, said to him: What is your thinking? On what basis do you pray for the death of these hooligans? Do you base yourself on the verse, as it is written: “Let sins cease from the land” (Psalms 104:35), which you interpret to mean that the world would be better if the wicked were destroyed? But is it written, let sinners cease?” Let sins cease, is written. One should pray for an end to their transgressions, not for the demise of the transgressors themselves.
Moreover, go to the end of the verse, where it says: “And the wicked will be no more.” If, as you suggest, transgressions shall cease refers to the demise of the evildoers, how is it possible that the wicked will be no more, i.e., that they will no longer be evil? Rather, pray for God to have mercy on them, that they should repent, as if they repent, then the wicked will be no more, as they will have repented.
Rabbi Meir saw that Berurya was correct and he prayed for God to have mercy on them, and they repented.