Adverse climatic conditions may differentially drive human migration patterns between rural and urban areas, with implications for changes in population composition and density, access to infrastructure and resources, and the delivery of essential goods and services. However, there is little empirical evidence to support this notion. In this study, we investigate the relationship between climate shocks and migration between rural and urban areas within Mexico. We combine individual records from the 2000 and 2010 Mexican censuses (n=683,518) with high-resolution climate data from Terra Populus that are linked to census data at the municipality level (n=2,321). We measure climate shocks as monthly deviation from a 30-year (1961-1990) long-term climate normal period, and uncover important nonlinearities using quadratic and cubic specifications. Satellite-based measures of urban extents allow us to classify migrant-sending and migrant-receiving municipalities as rural or urban to examine four internal migration patterns: rural-urban, rural-rural, urban-urban, and urban-rural. Among our key findings, results from multilevel models reveal that each additional drought month increases the odds of rural-urban migration by 3.6%. In contrast, the relationship between heat months and rural-urban migration is nonlinear. After a threshold of ~34 heat months is surpassed, the relationship between heat months and rural-urban migration becomes positive and progressively increases in strength. Policy and programmatic interventions may therefore reduce climate induced rural-urban migration in Mexico through rural climate change adaptation initiatives, while also assisting rural migrants in finding employment and housing in urban areas to offset population impacts.