Political scientists have long debated whether and how foreign policy shapes public opinion in democracies. Although some scholars suggest that domestic politics does not affect how leaders in democracies conduct foreign policy at all, an emerging consensus has in recent years documented the fundamental interplay between international politics and public opinion. According to this line of thinking, domestic audiences use foreign policy, leaders' decision-making during international crises, and the consequences of those decisions to evaluate leaders. These evaluations, in turn, constrain the behavior of leaders on the international stage since they wish to remain in office. While it is clear that foreign policy impacts the public opinion toward the political leadership making those decisions, the mechanisms specifying how remain subject to debate. Moreover, the growing importance of social media in electoral politics remains largely unaccounted for in this literature. This article begins to fill this gap by providing a theory and evidence from social media data that explains how social media conditions the effect of foreign policy on public opinion. To test our argument, we examine social media responses toward the U.S. decision to withdraw troops from Afghanistan in August 2021. The withdrawal is a salient policy event with important implications for studying the role of international politics in shaping public opinion over time. We use a dataset of 7 million tweets to measure the public opinion toward the withdrawal. Instead of relying on a specified group of users, we collect all tweets in the United States sent between August and September of 2021 that mention a list of keywords related to the Afghan withdrawal. This approach allows us to collect the most comprehensive corpus of tweets related to the Afghan withdrawal.