Infectious diseases often spread as spatial epidemic outbreak waves. A number of model studies have shown that such spatial pattern formation can have important consequences for the evolution of pathogens. Here, we show that such spatial patterns can cause cyclic evolutionary dynamics in selection for the length of the infectious period. The necessary reversal in the direction of selection is enabled by a qualitative change in the spatial pattern from epidemic waves to irregular local outbreaks. The spatial patterns are an emergent property of the epidemic system, and they are robust against changes in specific model assumptions. Our results indicate that emergent spatial patterns can act as a rich source for complexity in pathogen evolution.