A vaccine is disclosed that promotes CD4+ T cell-independent host defense mechanisms to defend against infection by fungi such as Pneumocystis subspecies (spp.). The vaccine may be used to prevent or to treat fungal infections. The novel vaccine can provide protective immunity, even for immunocompromised individuals such as HIV patients having reduced levels of CD4+ T cells.