The causes of erectile dysfunction during sex are many and often overlap, and in most cases a cause can be found and treated. If you lose your erection before penetration, during sex, or cannot keep it long enough to finish, you are far from alone, and it does not automatically mean something serious is wrong.

This guide explains the psychological and physical causes, how to tell them apart, when to see a doctor, and how diagnosis, treatment and prevention work.

What Is Erectile Dysfunction During Sex?

Erectile dysfunction (ED) is the repeated inability to get or keep an erection firm enough for sex. It can show up as:

  • Trouble getting an erection at all.

  • Getting an erection but losing it before or soon after penetration.

  • An erection that is not firm enough for intercourse.

Large studies suggest that about half of men aged 40 to 70 have some degree of ED, and the rate rises with age. But age is not the only factor. ED can appear earlier when stress, health problems or habits are involved.

Causes of erectile dysfunction during sex in men

How an Erection Works and Why It Can Fail

An erection needs four systems working together: the brain (arousal), the nerves (signals), hormones such as testosterone, and blood vessels that fill the penis with blood. When arousal begins, arteries widen, blood flow increases, and the penis traps the blood.

A problem in any one of these systems can cause ED: anxiety in the brain, nerve damage from diabetes, narrowed arteries, or low hormones. Finding which system is affected is the first step of treatment.

Is Losing an Erection Once or Twice a Problem?

No. Occasional trouble because of tiredness, stress or too much alcohol is normal. Doctors usually diagnose ED when the problem happens in many attempts over about three months or longer and bothers you or your partner.

Stress and performance anxiety as causes of erectile dysfunction during sex

Symptoms of Erectile Dysfunction

  • Difficulty getting an erection when aroused.

  • Losing the erection during sex.

  • Erections that are softer than before.

  • Reduced sexual desire in some cases.

  • Anxiety before sex because you fear it will happen again.

  • Weak or missing morning erections, which is useful information for your doctor.

Causes of Erectile Dysfunction During Sex

There are four main groups of causes, and many men have more than one.

1. Psychological Causes

The brain is the most important sex organ, so mental health matters, especially when the erection is lost during sex only.

  • Performance anxiety: Fear of failing creates a loop: more stress, then a lost erection, then more fear. It is one of the most common causes in younger men.

  • Stress: Work, money and family pressure raise stress hormones that interfere with arousal.

  • Depression and anxiety: They reduce desire and response, and some of the medications used to treat them can add to the problem.

  • Relationship problems: Conflict, poor communication and loss of trust affect intimacy directly.

  • A past bad experience: One episode can leave lasting fear.

  • Exhaustion and poor sleep.

Some studies link heavy pornography use with difficulty during real-life sex in some men, but the evidence is not yet conclusive.

2. Physical Causes

When the problem builds up gradually and happens in nearly every situation, a physical cause becomes more likely:

  • Heart disease and atherosclerosis: The penile arteries are tiny and are among the first to be affected by plaque. ED can appear years before heart symptoms, so doctors treat it as an early warning sign.

  • Diabetes: Long-term high blood sugar damages nerves and blood vessels and can cause ED at a younger age.

  • High blood pressure and high cholesterol: Both damage blood vessel walls and reduce blood flow.

  • Obesity and metabolic syndrome.

  • Low testosterone: Reduces desire and can weaken erections, often with fatigue.

  • Thyroid disorders and high prolactin.

  • Neurological conditions: Multiple sclerosis, stroke, spinal cord injury and Parkinson’s disease.

  • Pelvic surgery or radiation: Such as prostate removal or radiotherapy.

  • Chronic kidney or liver disease.

  • Sleep apnea.

  • Peyronie’s disease: Curvature of the penis that can cause pain and difficulty with penetration.

  • Venous leak: Blood enters but cannot be held, so the erection starts well and fades quickly. This fits the pattern of losing an erection during sex.

3. Lifestyle Causes

  • Smoking: Narrows and damages blood vessels. It is one of the biggest modifiable causes.

  • Alcohol: A little may relax you, but too much depresses the nervous system and weakens erections right away.

  • Recreational drugs and anabolic steroids.

  • Inactivity and poor diet.

  • Chronic lack of sleep.

4. Medications

Some medicines can cause ED as a side effect, including certain drugs for:

  • Blood pressure (some diuretics and beta-blockers).

  • Depression and anxiety (especially SSRIs).
  • Psychosis and epilepsy.

  • Pain (opioids).
  • Enlarged prostate or hair loss (finasteride, dutasteride).

  • Anti-androgen hormone therapies.

Important: Never stop a medicine on your own. Talk to your doctor, who may adjust the dose or switch you to an alternative.

Diabetes, blood pressure and heart disease as physical causes of erectile dysfunction

Erectile Dysfunction in Young Men

ED is not only for older men. In young men it is often psychological (performance anxiety, stress, relationship problems), but smoking, alcohol, drugs, steroids, poor sleep, obesity and undiagnosed diabetes are also common. If it lasts more than three months, see a doctor rather than guessing or buying unregulated products.

When to See a Doctor

Book an appointment if:

  • It lasts more than three months or happens often.

  • It began suddenly after an injury, surgery or a new medicine.

  • You have diabetes, high blood pressure or heart disease.

  • You have low desire and low energy together with missing morning erections.

  • You have penile pain or curvature.

  • It is affecting your mood or relationship.

Get urgent care if you have chest pain or shortness of breath with exertion, because ED can be linked to heart disease.

How Is Erectile Dysfunction Diagnosed?

Your doctor will ask about your history, lifestyle and medications, and may use a short questionnaire to rate severity. Then:

  1. Physical exam: blood pressure, weight, genital and nerve examination.

  2. Blood tests: blood sugar or HbA1c, cholesterol, testosterone (best in the morning), kidney, liver and thyroid function, and sometimes prolactin.

  3. Extra tests if needed: penile Doppler ultrasound for blood flow, or heart tests.

Treatment Options

Treatment depends on the cause and usually starts with the simplest steps.

1. Lifestyle Changes and Treating Underlying Conditions

  • Stop smoking and cut back on alcohol.

  • Control blood sugar, blood pressure and cholesterol.

  • Lose excess weight and exercise regularly.

  • Improve sleep and manage stress.

Many men improve once the underlying condition and habits are addressed.

2. Psychological and Sex Therapy

Helpful when anxiety, stress, depression or relationship problems are involved. It can include cognitive behavioral therapy, couples counseling and sensate-focus exercises that reduce performance pressure, and may be combined with medication.

3. Oral Medications

PDE5 inhibitors are the first-line treatment for many men. They improve blood flow to the penis when you are aroused and do not work without arousal. They should only be used with a prescription after a medical check, because they have important restrictions. They must never be combined with nitrate medicines (used for heart-related chest pain), since the combination can cause a dangerous drop in blood pressure. Only your doctor can decide the right dose.

4. Other Options Chosen by Your Doctor

  • Testosterone treatment when low levels are confirmed by blood tests.

  • Vacuum erection devices.

  • Penile injections or urethral suppositories.

  • Penile implants for severe cases that do not respond to other treatments.

  • Low-intensity shockwave therapy: still being studied, with limited evidence, and not a first-line option.

Warning: Avoid Herbal Sex Supplements and Unregulated Products

Health regulators have warned about products sold as “natural” sexual enhancers that were found to contain hidden drug ingredients in unknown amounts. This can be dangerous, especially for people with heart disease, high blood pressure or diabetes, or anyone taking nitrates. Do not buy any such product without talking to a doctor or pharmacist.

Practical Tips for the Bedroom

  • Talk openly with your partner. Hiding the problem increases stress; calm conversation reduces pressure and strengthens the relationship.

  • Do not make penetration the only goal. Focus on closeness and pleasure instead of performance.

  • Take time for foreplay. Enough arousal helps erections.

  • Avoid alcohol before sex.

  • Choose a relaxed time, away from fatigue and stress.Do not watch yourself anxiously. Self-monitoring makes it worse.
  • Do not watch yourself anxiously. Self-monitoring makes it worse.

  • Pelvic floor (Kegel) exercises: small studies suggest they may help some men.

How to Prevent Erectile Dysfunction

  • At least 150 minutes of moderate exercise per week.

  • A diet rich in vegetables, fruit, whole grains, fish and olive oil, with fewer saturated fats and sugars.

  • A healthy weight.

  • No smoking.

  • 7 to 8 hours of sleep.

  • Regular checks of blood sugar, blood pressure and cholesterol.

  • Seek support for ongoing anxiety or depression.

A healthy lifestyle lowers the risk of erectile dysfunction

FAQ

Frequently Asked Questions

Not always. It can be temporary because of stress or tiredness, but sometimes it is an early sign of heart disease or diabetes, so it is worth checking if it continues.

Both are possible. Psychological causes tend to start suddenly and leave morning erections intact; physical causes tend to start gradually and weaken morning erections. Often they overlap.

Yes. Both damage the blood vessels and nerves involved in erections, and controlling them is one of the best ways to improve.

In most cases it improves significantly once the cause is found and treated, through lifestyle changes, therapy, medication or other options. Results vary and no treatment works for everyone.

Not automatically. Some unregulated products contain undeclared drugs. Ask your doctor before using any of them.

Yes, often because of stress or habits such as smoking, alcohol and poor sleep, but physical causes should be ruled out if it continues.

Conclusion

The causes of erectile dysfunction during sex range from anxiety, stress and relationship problems to heart disease, diabetes, hormone problems, medications and harmful habits. The good news is that most are treatable once properly diagnosed, and speaking with a doctor is a sign of strength, not weakness. If the problem lasts more than three months, do not put off getting advice.

Medical Disclaimer

This article is for general information and awareness only. It does not replace advice from a qualified doctor or serve as a diagnosis or treatment plan. Do not start or stop any medication without consulting your doctor.