It is very difficult to know how international social linkages affect domestic ideological polarization because we can never observe polarization occurring both with and without international connections. To estimate this missing counterfactual, we employ a new statistical method based on Bayesian item-response theory that permits us to disaggregate polarization after the Arab Uprisings into domestic and transnational components. We collected a dataset of Twitter accounts in Egypt and Tunisia during the critical year of 2013, when the Egyptian military overthrew the Islamist President Mohamed Morsi. We find that the coup increased retweets among Egyptian ideological allies by 50% each day following the coup and decreased cross-ideological retweets by 25%. Tunisian Twitter communities also showed stronger intragroup retweeting although at lower levels than in Egypt. Counter-intuitively, our model shows that the additional polarization in Tunisia after the coup appears to have dampened further polarization among Islamists in Egypt.