Hepatitis B virus (HBV) is a major human pathogen that causes immune-mediated hepatitis. Successful immunity to HBV is age dependent: viral clearance occurs in most adults, whereas neonates and young children usually develop chronic infection. Using a mouse model of HBV infection, we sought mechanisms underpinning the age-dependent outcome of HBV and demonstrated that hepatic macrophages facilitate lymphoid organization and immune priming within the adult liver and promote successful immunity. In contrast, lymphoid organization and immune priming was greatly diminished in the livers of young mice, and of macrophage-depleted adult mice, leading to abrogated HBV immunity. Furthermore, we found that CXCL13, which is involved in B lymphocyte trafficking and lymphoid architecture and development, is expressed in an age-dependent manner in both adult mouse and human hepatic macrophages and plays an integral role in facilitating an effective immune response against HBV. Taken together, these results identify some of the immunological mechanisms necessary for effective control of HBV.