There’s nothing like a migraine attack to get you in the mood, right?

Wait, what? Cue the raised eyebrows.

In reality, sex might be the last thing on your noggin when it feels like an ice pick is lodged in it. But research has explored the relationship between sex and migraine. And like many other relationships, it’s complicated (no surprise here).

Does sex relieve migraine, or could it trigger an attack? Here’s what we know so far about sex and migraine.

Researchers wondered if getting it on provided pain relief for peeps with migraine. So they got all nosy and asked those people through a questionnaire.

In a small 2013 observational study of 304 people with chronic migraine, about 100 of them reported that they had experience with doing the deed during an attack. And about 60 percent reported an improvement in their symptoms.

More research is needed on the exact mechanisms that might be at play regarding sex and migraine relief. But it’s not a stretch to consider that a little time twisting in the sheets with a partner (or yourself!) might mitigate head misery for some people.

During foreplay and sex, our bodies are flooded with feel-good chemicals such as endorphins and oxytocin. These substances generate a sense of euphoria and well-being and provide pain relief. Who couldn’t use a bit of that when coping with a migraine attack?

So, can getting freaky freak out your head? Let’s look at that same observational study for some insight.

It found that sex made migraine attacks worse for 33 percent of people. So if you’re already in the throes of a migraine, shagging could supercharge your symptoms.

But that’s not all. If you’re feeling fine and dandy, getting randy could also bring on a migraine episode in a roundabout way.

It’s not usually the deed itself that causes a migraine attack (the American Migraine Foundation doesn’t list sex as a common trigger).

But, according to research published in 2013, exercise has been known to set migraine attacks into action. And since sex can be a full-contact sport, it’s not surprising that it could cause migraine attacks for some people.

There’s even a type of headache specifically linked to fooling around.

Remember, migraine is a neurological disorder. So the headache called “primary headache associated with sexual activity” is a completely different animal, even though (like migraine) it can cause head pain. It occurs during or after sexual excitement or the Big O.

This type of primary headache is typically located in the back of the head on both sides. If you tend to get a head-pounder after a little, ahem, headboard pounding, you should definitely contact a medical professional to figure out what’s going on.

First things first: You never have to have sex if you’re not into it for any reason — whether that’s because you’ve got a headache or because you just don’t feel like it. And you shouldn’t feel pressured (nor should you pressure someone else) into using sex for migraine relief.

But bumping nasties may help some people feel a little better during a migraine episode. If you’ve been tempted to try the horizontal tango mid-migraine, here are some tips:

  • Communicate with your partner. Tell them you’re having a migraine attack, so they can be extra aware of your needs in terms of pacing and positioning.
  • Keep movements to a minimum. Too much motion can worsen migraine symptoms like pain, dizziness, and nausea. So move slowly if you’re changing positions or try to stay in a position that keeps your head still.
  • Play out the pleasure. Enjoying your partner’s touch — and touching them — can help boost the flood of endorphins and oxytocin. So take your time with back rubs or exploring each other’s erogenous zones.
  • Sex doesn’t have to mean penetration or intercourse. The things that usually make you feel good in the bedroom might not work during a migraine attack. A heavy make-out or cuddling session — or getting the toys involved — might be what you’re craving instead, so explore.
  • You can stop at any time. If during foreplay or sex you want to stop, migraine attack or not, you have the right to end the activity. Consent is an ongoing agreement that can be changed at any time.

Is sex the ultimate migraine wonder drug? In anecdotal research, people with migraine provided mixed reviews on coitus as a migraine reliever. For some folks, sex made migraine better, but for others, it made symptoms worse.

The verdict is that it probably depends on the person and maybe even the migraine episode.

So sex is just one of those potential natural remedies for migraine you’ll have to test-drive for yourself. But maybe now you have another reason to dim the lamp when you have a migraine: mood lighting.