A woman’s period generally lasts about two to eight days. During this time of menstruation, symptoms such as cramps and headaches can occur.

Headaches are caused by a variety of reasons, but generally speaking they’re the result of swelling or tightening of pressure on your nerves. When the pressure around your nerves changes, a pain signal is sent to your brain, leading to the aching, throbbing pain of a headache.

Read on to find out what happens during menstruation that can trigger headaches.

If you experience a headache, it may be due to dehydration, stress, genetic or dietary triggers, or a host of other causes. However, headaches directly after or even before your period may be due to causes linked to your period, such as:

Hormonal imbalances

When you have your period, your hormone levels dramatically fluctuate. Hormone levels can be further affected if you’re taking birth control. Estrogen and progesterone are the two hormones that fluctuate throughout the course of the menstrual cycle.

Changing levels of estrogen and progesterone can trigger headaches. Everyone is different, and you may experience headaches either at the beginning, the middle, or the end of your period. However, headaches are very common during the menstrual cycle and shouldn’t be a major cause for concern.

Some women get extremely painful headaches called menstrual migraines that are the result of changing hormonal levels. The symptoms of menstrual migraines are severe and can include:

Low iron levels

During menstruation, blood and tissue is shed through the vagina. Some women experience particularly heavy periods, with greater blood loss compared to that of others.

Women who have very heavy flows and lose lots of blood are more likely to have iron deficiencies at the end of their period. Low iron levels are another likely cause for headaches after a period.

Headaches will usually resolve themselves with rest or sleep. However, you can try certain treatments to help speed up the process or minimize the pain of headaches after your period:

  • Use a cold compress to relieve tension and constrict blood vessels.
  • Use over-the-counter (OTC) nonsteroidal anti-inflammatory drugs (NSAIDs) like ibuprofen (Advil) or an analgesic such as acetaminophen (Tylenol).
  • Drink lots of water to stay hydrated.

If you’re experiencing hormonal headaches, your doctor may prescribe:

  • estrogen supplementation with a pill, gel, or patch
  • magnesium
  • continuous dosing of birth control pills

If you’re experiencing headaches related to iron deficiencies, you can try iron supplementation or eating a diet rich in iron with foods such as:

  • shellfish
  • greens (spinach, kale)
  • legumes
  • red meat

Many women experience headaches as part of their menstrual cycle. You can try treating yours with hormonal therapy, iron supplementation, or OTC pain medications. Sometimes the best thing you can do is simply to lie down in a cool, dark, quiet room and wait until the headache passes.

It’s always a good idea to speak with your doctor about any concerns you have, especially if you experience particularly painful or prolonged headaches.

If you have an unusually severe headache that isn’t responding to treatments at home, you should seek urgent care for evaluation to confirm that it isn’t due to another cause.