The surface of the eye is a mucosal site exposed to the environment, but existence of a resident ocular microbiome has been highly contentious. We used a mouse model of ocular surface disease to reveal that the surface of the eye indeed harbors resident microbes that tune the local immune response, affording protection from pathogenic organisms. We isolated and identified Corynebacterium mastitidis as a bona fide ocular surface commensal that elicits a commensal-specific interleukin 17 response from γδ T cells in the ocular mucosa. This causes recruitment of neutrophils and secretion of antimicrobials into the tears, and provides resistance to infection with C. albicans and P. aeruginosa. As a microorganism that confers a protective phenotype, C mastitidis satisfies all 4 Koch’s postulates for a causative agent, and constitutes an important proof of concept that a resident commensal flora indeed exists on the surface of the eye and contributes to ocular mucosal homeostasis.