Headache is an important cause of minor postoperative morbidity. In this study we evaluated the association of anesthesia and surgery with the occurrence of postoperative headache in elective surgery patients. After obtaining ethical approval, 446 patients were enrolled in this prospective, single-centre cohort study. Participants were interviewed preoperatively, and for five days postoperatively, regarding the appearance of headache, while demographics, lifestyle, type of anesthesia and surgery, the anesthetic drugs administered and intraoperative adverse effects were recorded. Multiple logistic regression analysis was conducted in order to identify independent factors associated with postoperative headache, both in the total sample and in patients without previous history of headache. The observed overall frequency of postoperative headache was 28.3% (N = 126) in the total sample. In patients with previous history of headache, the frequency of postoperative headache was 41% (N = 89), while in those with no history the frequency of postoperative headache was 16.2% (N = 37). Female gender [p = 0.024; odds ratio (OR) = 2.1], sevoflurane administration (p < 0.001; OR = 3.66), intraoperative hypotension (p = 0.008; OR = 2.12) and smoking (p = 0.006; OR = 1.74) were independently associated with postoperative headache. In patients without previous history, female gender (p = 0.005; OR = 4.77), sevoflurane administration (p = 0.001; OR = 6.9), intraoperative hypotension (p = 0.006; OR = 6.7) and caffeine consumption (p = 0.041; OR = 5.28) presented greater likelihood for postoperative headache, while smoking revealed no association. Female gender, sevoflurane, smoking and intraoperative hypotension were documented as independent risk factors for postoperative headache. In patients with no previous history of headache, caffeine consumption was an additional independent factor for postoperative headache, while smoking revealed no association.