A major area of current research is to understand how climate change will impact species interactions and ultimately biodiversity. A variety of environmental conditions are rapidly changing owing to climate warming, and these conditions often affect both the strength and outcome of species interactions. We used fish distributions and replicated fish introductions to investigate environmental conditions influencing the coexistence of two fishes in Swedish lakes: brown trout (Salmo trutta) and pike (Esox lucius). A logistic regression model of brown trout and pike coexistence showed that these species coexist in large lakes (more than 4.5 km(2)), but not in small, warm lakes (annual air temperature more than 0.9-1.5 degrees C). We then explored how climate change will alter coexistence by substituting climate scenarios for 2091-2100 into our model. The model predicts that brown trout will be extirpated from approximately half of the lakes where they presently coexist with pike and from nearly all 9100 lakes where pike are predicted to invade. Context dependency was critical for understanding pike-brown trout interactions, and, given the widespread occurrence of context-dependent species interactions, this aspect will probably be critical for accurately predicting climate impacts on biodiversity.