There is little prospectively gathered data on the course of headaches during pregnancy and postpartum, and the influence of breastfeeding is unclear. This is a large, prospective study, which invited all pregnant women in the catchment area during a defined period. All participants (n = 2,126) filled in questionnaires concerning headache. Among these, a total of 208 women with migraine according to the International Headache Society criteria also filled in detailed headache diaries during pregnancy and the puerperal period. Freedom from earlier headaches during pregnancy was significantly more common than new onset of headache during pregnancy (p < 0.001). This was not influenced by prior use of oral contraceptives. According to the diaries, there was a gradual decrease during pregnancy in the frequency of all headaches and of self-considered migraine. There was also a significant decrease in the duration of headaches (p < 0.001) during pregnancy compared to before. Earlier parity did not influence the course. Apart from a significant increase during the first week postpartum (p < 0.01), the overall occurrence of headaches during puerperium did not differ from the pregnancy period. Compared to pregnancy, there was a postpartum increase in the mean intensity (p < 0.01) and duration (p = 0.050) of headaches, as well as in the mean number of analgesics used (p < 0.001). Breastfeeding did not influence the occurrence of headaches postpartum. These data are of practical value for informing pregnant migraineurs about the typical clinical prospects and for giving advice on breastfeeding.