This paper examines how politicians respond to an unprecedented shock that dramatically alters the importance of a specific issue on their agendas. It focuses on the effects of the Venezuelan crisis, which has led to a significant influx of over 6.1 million immigrants into Latin American countries. Utilizing computational text-analysis methods such as Wordscores, unsupervised topic analysis, and OpenAI’s API, applied to a corpus of over 3 million tweets from Chilean and Peruvian parliament members between 2013 and 2021, we identify statements about immigration, their stances (pro or anti-immigration), ideologies, and the framing used. We find that all party families increase the salience of the immigration issue without notable differences independent of the geographic exposure to the shock. Additionally, we find a positive causal link between the size of the immigrant population in the electoral district and the publication of pro-immigration statements on Twitter, primarily originating from left-wing politicians. However, we also document null effects of politicians’ exposure to more immigrants in their districts on the number of tweets about immigration. Employing other NLP techniques, we explore and provide suggestive evidence that parties use distinct vocabularies aligned with their ideologies and emphasize different aspects when discussing immigration. This study contributes to understanding political behavior and communication strategies in the face of demographic changes, offering insights into how economic and social pressures influence policy discourse and public opinion formation in emerging economies.