Coinfection of host populations alters pathogen prevalence, host mortality, and pathogen evolution. Because pathogens compete for limiting resources, whether multiple pathogens can coexist in a host population can depend on their within-host interactions which, in turn, can depend on the order in which pathogens infect hosts (within-host priority effects). However, the consequences of within-host priority effects for pathogen coexistence have not been tested. Using laboratory studies with a coinfected zooplankton system, we found that pathogens had increased fitness in coinfected hosts when they were the second pathogen to infect a host, compared to when they were the first pathogen to infect a host. With these results, we parameterized a pathogen coexistence model with priority effects, finding that pathogen coexistence (1) decreased when priority effects increased the fitness of the first pathogen to arrive in coinfected hosts, and (2) increased when priority effects increased the fitness of the second pathogen to arrive in coinfected hosts. We also identified the natural conditions under which we expect within-host priority effects to foster coexistence in our system. These outcomes were the result of positive or negative frequency dependence created by feedback loops between pathogen prevalence and infection order in coinfected hosts. This suggests that priority effects can systematically alter conditions for pathogen coexistence in host populations, thereby changing pathogen community structure and potentially altering host mortality and pathogen evolution via emergent processes