Understanding the responses of aquatic animals to temperature variability is essential to predict impacts of future climate change and to inform conservation and management. Most ectotherms such as fish are expected to adjust their behaviour to avoid extreme temperatures and minimize acute changes in body temperature. In coastal Skagerrak, Norway, sea surface temperature (SST) ranges seasonally from 0 to over 20°C, representing a challenge to the fish community which includes cold-, cool- and warm-water affinity species. By acoustically tracking 111 individuals of Atlantic cod Gadus morhua, pollack Pollachius pollachius and ballan wrasse Labrus bergylta in 2015-2018, we examined how coexisting species within a fish community adjusted their behaviour (i.e. vertical distribution in the water column and habitat selection) to cope with the thermal variation. Mixed-effect models showed that thermal preference was a main driver of behaviour and habitat use of the fish community in a southern Norwegian fjord. Cod used colder waters, compared with pollack and ballan wrasse. Increases in SST during summer were associated with the use of deeper, colder waters by cod, especially by larger individuals, and conversely with the occupancy of shallower areas by pollack and ballan wrasse. During winter, when SST dropped and the thermal stratification reversed, pollack and ballan wrasse moved to deeper, relatively warmer areas, while cod selected shallower, colder habitats. Although habitat selection was affected by temperature, species-specific habitat selection was observed even when temperature was similar throughout habitats. This study shows how cohabiting fish species respond to thermal heterogeneity, suggesting that (a) temperature regulates the access to the different depths and habitats and (b) behavioural plasticity may be an important factor for coping with temperature variability and potentially for adaptation to climate change.