Corals of the eastern tropical Pacific live in a marginal and oceanographically dynamic environment. Along the Pacific coast of Panam a, stronger seasonal upwelling in the Gulf of Panam a in the east transitions to weaker upwelling in the Gulf of Chiriqu ı in the west, resulting in complex regional oceanographic conditions that drive differential coral-reef growth. Over millennial timescales, reefs in the Gulf of Chiriqu ı recovered more quickly from climatic disturbances compared with reefs in the Gulf of Panam a. In recent decades, corals in the Gulf of Chiriqu ı have also had higher growth rates than in the Gulf of Panam a. As the ocean continues to warm, however, conditions could shift to favor the growth of corals in the Gulf of Panam a, where upwelling may confer protection from high-temperature anomalies.Here we describe the recent spatial and temporal variability in surface oceanography of nearshore environments in Pacific Panam a and compare those conditions with the dynamics of contemporary coral-reef communities during and after the 2016 coral-bleaching event. Although both gulfs have warmed significantly over the last 150 yr, the annual thermal maximum in the Gulf of Chiriqu ı is increasing faster, and ocean temperatures there are becoming more variable than in the recent past. In contrast to historical trends, we found that coral cover, coral survival, and coral growth rates were all significantly higher in the Gulf of Panam a. Corals bleached extensively in the Gulf of Chiriqu ı following the 2015-2016 El Niño event, whereas upwelling in the Gulf of Panam a moderated the high temperatures caused by El Niño, allowing the corals largely to escape thermal stress. As the climate continues to warm, upwelling zones may offer a temporary and localized refuge from the thermal impacts of climate change, while reef growth in the rest of the eastern tropical Pacific continues to decline.