The liver contains a variety of resident immune cells, such as NK cells, NKT cells, T cells, macrophages, and dendritic cells. However, little is known about how IL-7, which is produced by hepatocytes, functions locally in development and maintenance of liver immune cells. To address this question, we established IL-7-floxed mice and crossed them with albumin promoter-driven Cre (Alb-Cre) transgenic mice to establish conditional knockout of IL-7 in hepatocytes. The levels of IL-7 transcripts were reduced 10-fold in hepatocyte fraction. We found that the absolute numbers of NKT and T cells were significantly decreased in adult liver of IL-7(f/f) Alb-Cre mice compared with IL-7(f/f) control mice. In contrast, NK cells, dendritic cells, and B cells were unchanged in the IL-7(f/f) Alb-Cre liver. The number of Vα14(+) invariant NKT cells was significantly reduced in liver, but not in thymus and spleen, of IL-7(f/f) Alb-Cre mice. Furthermore, B cell development was impaired in perinatal liver of IL-7(f/f) Alb-Cre mice. This study demonstrates that hepatocyte-derived IL-7 plays an indispensable role in maintenance of NKT and T cells in adult liver and development of B cells in fetal liver, and suggests that hepatocytes provide a unique IL-7 niche for intrahepatic lymphocytes.