Primary schools represent important environments for biodiversity exposure and thus may play a crucial role on early-life immunomodulation, protecting against allergic sensitization. The aim of this study was to understand how the exposure to different levels of species richness surrounding urban primary schools may influence the development of allergic diseases and asthma in children. A species richness index (SRI), evaluating habitat diversity in terms of amphibians, birds, reptiles, and small mammals, was estimated and attributed to 20 primary schools in the city of Porto, Portugal. The SRI was measured considering a 100m straight-line buffer around the schools. Children who attended the participating schools were invited to participate in the study, performed spirometry with bronchodilation and skin-prick tests, and had their parents fill a questionnaire concerning allergy and asthma symptoms, as well as demographic and socioeconomic data. Asthma was defined according to three distinct criteria. The study results showed significant and positive associations between the exposure to species richness in schools and the forced expiratory volume at the first second (FEV1 ) and forced vital capacity (FVC) parameters both before and after bronchodilation, independently of the asthma and atopic status. Fully adjusted models revealed that a unitary increment in the SRI was associated with an average increase of approximately 2 and 3mL in FEV1 and FVC, respectively. Species richness in school surroundings may impact lung function development in children. However, this increase in lung function was not associated with any clinically relevant protective effect on allergy and asthma development.