We develop a model of human interaction to analyze the relationship between globalization and pandemics. Our framework provides joint microfoundations for the gravity equation for international trade and the Susceptible-Infected-Recovered (SIR) model of disease dynamics. We show that there are cross-country epidemiological externalities, such that whether a global pandemic breaks out depends critically on the disease environment in the country with the highest rates of domestic infection. A deepening of global integration can either increase or decrease the range of parameters for which a pandemic occurs, and can generate multiple waves of infection when a single wave would otherwise occur in the closed economy. If agents do not internalize the threat of infection, larger deaths in a more unhealthy country raise its relative wage, thus generating a form of general equilibrium social distancing. Once agents internalize the threat of infection, the more unhealthy country typically experiences a reduction in its relative wage, through individual-level social distancing. Incorporating these individual-level responses is central to generating large reductions in the ratio of trade to output and implies that the pandemic has substantial effects on aggregate welfare, through both deaths and reduced gains from trade.