1. While much is known about the direct effect that temperature can have on aquatic communities, less is known about its indirect effect via the temperature dependence of viscosity and temperature-dependent trophic interactions.
2. We manipulated the temperature (5–20 °C) and the viscosity (equivalent to 5–20 °C) of water in laboratory-based bacteria–protist communities. Communities contained food chains with one, two or three trophic levels. Responses measured were population dynamics (consumer carrying capacity and growth rate, average species population density, and the coefficient of variation of population density through time) and ecosystem function (decomposition).
3. Temperature, viscosity and food chain length produced significant responses in population dynamics. Temperature-dependent viscosity had a significant effect on the carrying capacity and growth rates of consumers, as well as the average density of the top predator. Overall, indirect effects of temperature via changes in viscosity were subtle in comparison to the indirect effect of temperature via trophic interactions.
4. Our results highlight the importance of direct and indirect effects of temperature, mediated through trophic interactions and physical changes in the environment, both for population dynamics and ecosystem processes. Future mechanistic modelling of effects of environmental change on species will benefit from distinguishing the different mechanisms of the overall effect of temperature.