While politicians often argue that economic sanctions can induce policy changes in targeted states by undermining elite and public support for the reigning government, the efficacy of these measures, particularly against non-democratic regimes, is debatable. We propose that, counterintuitively, economic sanctions can bolster rather than diminish support for the sanctioned government, even in non-democratic contexts. However, this support shift and its magnitude can differ across various political factions and depend on the nature of the sanctions. To empirically evaluate our theoretical expectations, we use supervised machine learning to scrutinize nearly 2 million tweets from over 1,000 Iranian influencers, assessing their responses to both comprehensive and targeted sanctions during Donald Trump’s presidency. Our analysis shows that comprehensive sanctions generally improved sentiments toward the Iranian government, even among its moderate oppositions, rendering them more aligned with the state’s stance. Conversely, while targeted sanctions elicited a milder rally-around-the-flag response, the identity of the targeted entity plays a crucial role in determining the scale of this reaction.