Epstein-Barr virus is ubiquitous and is causally implicated in lymphoid and epithelial malignancies. Virus invades oropharyngeal mucosa and establishes latency in B lymphocytes. Reactivating lymphocytes shed virus into saliva for spread to new hosts. A complex of three virus glycoproteins, gH, gL and gp42, is essential for entry. B-cell entry requires binding of gp42 to human leukocyte antigen (HLA) class II whereas entry into epithelial cells lacking HLA class II requires complexes without gp42. To accommodate infection of each, the virus carries both three-part and two-part complexes. We show here that HLA class II in the virus-producing cell alters the ratio of three-part to two-part complexes. As a consequence, virus originating in epithelial cells efficiently infects B cells whereas B-cell derived virus better infects epithelial cells. This molecular switch is a novel strategy that could alter tropism of virus from epithelium to B cells and then back to epithelium in a new host.