Macrophages represent a key cellular component of the liver, and are essential for maintaining tissue homeostasis and ensuring rapid responses to hepatic injury. Our understanding of liver macrophages has been revolutionized by the delineation of heterogeneous subsets of these cells. Kupffer cells are a self-sustaining, liver-resident population of macrophages and can be distinguished from the monocyte-derived macrophages that rapidly accumulate in the injured liver. Specific environmental signals further determine the polarization and function of hepatic macrophages. These cells promote the restoration of tissue integrity following liver injury or infection, but they can also contribute to the progression of liver diseases, including hepatitis, fibrosis and cancer. In this Review, we highlight novel findings regarding the origin, classification and function of hepatic macrophages, and we discuss their divergent roles in the healthy and diseased liver.