Upon phagocytosis, Legionella pneumophila translocates numerous effector proteins into host cells to perturb cellular metabolism and immunity, ultimately establishing intracellular survival and growth. VipD of L. pneumophila belongs to a family of bacterial effectors that contain the N-terminal lipase domain and the C-terminal domain with an unknown function. We report the crystal structure of VipD and show that its C-terminal domain robustly interferes with endosomal trafficking through tight and selective interactions with Rab5 and Rab22. This domain, which is not significantly similar to any known protein structure, potently interacts with the GTP-bound active form of the two Rabs by recognizing a hydrophobic triad conserved in Rabs. These interactions prevent Rab5 and Rab22 from binding to downstream effectors Rabaptin-5, Rabenosyn-5 and EEA1, consequently blocking endosomal trafficking and subsequent lysosomal degradation of endocytic materials in macrophage cells. Together, this work reveals endosomal trafficking as a target of L. pneumophila and delineates the underlying molecular mechanism.