The immune system has a vital role in the renal response to acute kidney injury (AKI). In this Review, Hye Ryoun Jang and Hamid Rabb describe current understanding of the function of the innate and adaptive immune systems in the early and late injury phases of ischaemic and nephrotoxic AKI, and describe the influence of immune cells on recovery and long-term outcome following AKI.