Aspergillus fumigatus is an important human fungal pathogen and its conidia are constantly inhaled by humans. In immunocompromised individuals, conidia can grow out as hyphae that damage lung epithelium. The resulting invasive aspergillosis is associated with devastating mortality rates. Since infection is a race between the innate immune system and the outgrowth of A. fumigatus conidia, we use dynamic optimization to obtain insight into the recruitment and depletion of alveolar macrophages and neutrophils. Using this model, we obtain key insights into major determinants of infection outcome on host and pathogen side. On the pathogen side, we predict in silico and confirm in vitro that germination speed is an important virulence trait of fungal pathogens due to the vulnerability of conidia against host defense. On the host side, we found that epithelial cells, which have been underappreciated, play a role in fungal clearance and are potent mediators of cytokine release. Both predictions were confirmed by in vitro experiments on established cell lines as well as primary lung cells. Further, our model affirms the importance of neutrophils in invasive aspergillosis and underlines that the role of macrophages remains elusive. We expect that our model will contribute to improvement of treatment protocols by focusing on the critical components of immune response to fungi but also fungal virulence traits.