Losing an erection during sex usually traces back to one of a handful of causes, and in most cases it involves more than one at the same time. The difficulty can be vascular, hormonal, neurological, psychological, medication-related, or some combination. Studies report that erectile difficulties affect up to about a third of younger men and become more common with age, yet many people assume it is purely a mental problem or purely a physical one, when the reality is rarely that clean-cut.
The Vascular Connection Most People Miss
An erection depends on blood flowing into the penis faster than it flows out. Anything that damages the lining of blood vessels, called the endothelium, can undermine that process. This is why erectile dysfunction and cardiovascular disease are now considered two expressions of the same underlying problem. Research shows that erection difficulties often appear two to five years before a cardiovascular event, making them an early warning signal rather than just an inconvenience.1PubMed Central. Endothelial Dysfunction, Erectile Deficit and Cardiovascular Disease: An Overview of the Pathogenetic Links
The penile arteries are smaller than the coronary arteries, so plaque buildup or stiffening of vessel walls shows up there first. If you have high blood pressure, elevated cholesterol, or poorly controlled blood sugar, those conditions chip away at the endothelium everywhere in the body. The penis just happens to be the canary in the coal mine. This is one reason doctors take erection complaints seriously even in otherwise healthy-seeming people: the issue may reflect something systemic that has not yet produced chest pain or shortness of breath.
Diabetes and Nerve Damage
Diabetes deserves its own mention because it attacks erections from two directions at once. First, chronically high blood sugar damages blood vessels the same way it does elsewhere in the body. Second, it damages nerves. The nerves that trigger an erection rely on nitric oxide signaling, and diabetic neuropathy disrupts that signaling at its source. Research has linked reduced availability of certain neurotrophic factors in diabetes to impaired nitric oxide release, directly compromising the nerve-driven relaxation of penile tissue that starts an erection.2PubMed Central. Diabetic Neuropathy and Erectile Dysfunction: Unveiling the Neural Pathways Behind a Vascular Symptom When both vascular and nerve pathways are degraded, the problem becomes especially stubborn.
Sleep Apnea and the Overnight Connection
Obstructive sleep apnea is an overlooked contributor. When breathing repeatedly stops and restarts during sleep, it triggers a chain of vascular and inflammatory events. Circulating nitric oxide levels drop, oxygen radicals increase, and endothelial function deteriorates.3PubMed Central. Erectile Dysfunction and Obstructive Sleep Apnea: A Review This can diminish overnight erections, which are a normal part of healthy sleep, and carry over into waking sexual activity. If you snore heavily, feel unrested despite sleeping enough hours, or wake with headaches, sleep apnea may be a piece of the puzzle you have not considered.
Performance Anxiety and the “Spectatoring” Trap
The psychological side of erection problems is real and well-documented, but it works in a more specific way than most people realize. It is not just about being “nervous.” Research into cognitive patterns shows that a tendency to fixate on mistakes and monitor your own performance, sometimes called spectatoring, is closely linked to poorer sexual functioning. When you step outside the experience to judge how you are doing, you pull attention away from the physical and emotional cues that keep arousal going.4PubMed Central. Cognitive Inflexibility and Heightened Error Monitoring Are Related to Lower Sexual Functioning
Body image plays a similar role. Men who feel self-conscious about their bodies experience more cognitive distraction during sex, which pulls their attention away from erotic cues and makes it harder to stay aroused.5PubMed Central. Exploring the Roles of Body Dissatisfaction, Cognitive Distraction, and Age in Sexual Distress Related to Sexual Function and Sexual Satisfaction in Men This is not a character flaw; it is a measurable cognitive pattern. Your brain has limited bandwidth. The more of it goes to self-criticism, the less is available for arousal.
The vicious cycle is the real danger here. You lose your erection once, then the next time you are anxious about it happening again, which makes it more likely to happen, which reinforces the anxiety. Within a few episodes, what started as a fluke can solidify into a recurring problem with a psychological layer that feels impossible to break out of on your own.
When Testosterone Is Actually the Issue
Low testosterone gets blamed for erection problems far more often than it deserves. Testosterone is genuinely important for sexual function, but its strongest connection is to desire rather than to the physical mechanics of getting hard. Research clarifies that low sexual desire is the most reliable symptom of low testosterone, while loss of erection is better explained by aging or other health conditions once those are accounted for.6PubMed Central. The role of testosterone in male sexual function
That does not mean testosterone is irrelevant. If you have genuinely low levels, desire drops, spontaneous erections fade, and the overall drive that makes sex feel worth initiating erodes. But if your desire is fine and you still struggle to maintain an erection, low testosterone is unlikely to be the main culprit. Getting tested is reasonable, especially if you are experiencing fatigue, reduced muscle mass, or low mood alongside sexual problems. Just be wary of the online marketing machine that frames testosterone as a universal fix. For most men with erection difficulties, the issue lies elsewhere.
Medications That Interfere
A significant and underappreciated cause of erection problems is the medication you are already taking. Antidepressants, particularly SSRIs, are well known for causing a range of sexual side effects including decreased desire, difficulty with arousal, and delayed or absent orgasm.7PubMed Central. Antidepressant-associated sexual dysfunction: impact, effects, and treatment These effects are common enough that they are a leading reason people stop taking their antidepressants, which creates its own set of problems.
Beyond antidepressants, blood pressure medications (especially older beta-blockers and some diuretics), anti-anxiety drugs, antihistamines, and certain prostate medications can all impair erections. If your difficulties started around the same time as a new prescription or a dose change, that timing matters. Do not stop any medication without talking to your doctor, but do bring it up. Switching to a different drug in the same class or adjusting timing can sometimes resolve the problem without sacrificing the treatment you need.
Alcohol, Nicotine, and Other Substances
Alcohol is a paradox. A small amount can reduce inhibitions and make you feel more relaxed, but alcohol is fundamentally a depressant that impairs the nervous system’s ability to coordinate an erection. Chronic heavy drinking causes hormonal imbalances, liver damage, and reduced blood flow to penile tissue.8PubMed Central. Substance Abuse and Sexual Functioning: An Overview of Mechanisms Even a single night of heavy drinking can cause temporary erectile failure, and most men have experienced this at least once.
Nicotine deserves attention too, and not just traditional cigarettes. A large population-level study found that men who vaped daily were roughly twice as likely to report erectile dysfunction compared to men who had never used e-cigarettes.9PubMed. Association of E-Cigarettes With Erectile Dysfunction: The Population Assessment of Tobacco and Health Study Nicotine constricts blood vessels, and the penile arteries are particularly sensitive to that effect. If you vape and have noticed erection problems, the two may be connected in a way that is easy to overlook because vaping is so commonly perceived as less harmful than smoking.
Recreational drugs including cocaine, amphetamines, and opioids each have their own pathways to sexual dysfunction, ranging from blood vessel constriction to hormonal disruption to direct nerve suppression. Cannabis is more ambiguous; some men report it enhances their experience, but regular use can lower testosterone and impair arousal over time.
The Pornography Question
Whether pornography causes erectile difficulties in real-life sexual encounters is one of the more debated topics in sexual health. The concern is not moral but neurological. A review of clinical evidence has raised the possibility that the properties unique to internet pornography, including unlimited novelty, easy escalation to more extreme material, and constant video stimulation, may condition arousal in ways that do not transfer to partnered sex.10PubMed Central. Is Internet Pornography Causing Sexual Dysfunctions? A Review with Clinical Reports
Population-level data adds some weight to this. A Swedish national probability survey found that men who used pornography three or more times per week had roughly double the odds of reporting erection problems compared to less frequent users.11PubMed. Frequency of Pornography Use and Sexual Health Outcomes in Sweden That does not prove causation; men with existing sexual dissatisfaction may turn to pornography more often. But qualitative research with heavy users paints a concerning picture. Some men describe diminished physical sensitivity during prolonged sessions, binge-driven sexual exhaustion, and temporary inability to respond to a real partner afterward.12PubMed Central. Clarifying and extending our understanding of problematic pornography use through descriptions of the lived experience
The honest assessment: occasional pornography use is unlikely to cause erection problems in most men. Heavy, frequent use, especially the binge pattern where you spend hours searching for new material, is associated with more problems. If you notice that your response to a partner has dulled while your response to a screen has not, that pattern is worth taking seriously. Cutting back or taking a break is a low-risk experiment with potentially useful information.
Erection Problems in Younger Men
There is a persistent myth that erection problems are an older man’s issue. In fact, the prevalence of erectile difficulties in young men varies widely across studies, with some reporting rates as high as 35%.13PubMed Central. Erectile Dysfunction in Young Adults: A Narrative Review While psychological factors like performance anxiety, depression, and relationship stress are more commonly the primary driver in younger men, a meaningful proportion also have organic causes including vascular problems, hormonal imbalances, and metabolic syndrome.
Condom-related erection loss is another issue that disproportionately affects younger men and rarely gets discussed. Research has found that men who experience condom-associated erection problems show smaller initial erectile responses regardless of context, suggesting it is not just about the interruption of putting one on, but may reflect underlying arousal sensitivity differences.14PubMed Central. Patterns of sexual arousal in young, heterosexual men who experience condom-associated erection problems (CAEP) Trying different condom sizes or materials, or incorporating the condom into foreplay rather than treating it as a pause, can help. But if the problem persists across different situations, it may point to a broader arousal issue worth exploring.
Structural and Anatomical Factors
Less commonly discussed is Peyronie’s disease, a condition where fibrous scar tissue, called plaque, develops inside the penis and causes curvature, pain, or both. It can develop after injury, sometimes an injury so minor you do not remember it, and it frequently causes or worsens erectile dysfunction.15PubMed Central. Peyronie’s Disease: A Review The plaque itself can restrict blood flow or prevent the tissue from expanding normally during arousal. If you have noticed a new bend or hard lump in the shaft along with erection changes, that is worth bringing to a urologist’s attention specifically.
Venous leak is another structural problem, though it is rarer. In a normal erection, blood fills the erectile tissue and the veins compress to keep it there. If an abnormal vein allows blood to drain too quickly, the erection cannot be maintained. One case study documented an aberrant vein draining blood from the erectile tissue, and after targeted treatment, erections improved almost immediately.16PubMed Central. Abnormal deep dorsal vein resulting in veno-occlusive erectile dysfunction Venous leak is not something you can diagnose yourself, but it is worth knowing it exists so that if standard treatments fail, you can ask about further vascular evaluation.
Figuring Out Whether It Is Physical or Psychological
One of the most practical clues is what happens when you are asleep. Healthy men have several erections during sleep, typically during REM phases. If you wake up with morning erections or notice nighttime erections, the plumbing likely works. That points more strongly toward psychological or situational factors. If morning erections have disappeared along with sexual erections, the problem is more likely to have a physical component.
Another clue is context. If you can get and keep an erection during masturbation but not with a partner, or with one partner but not another, or in relaxed situations but not stressful ones, the issue probably has a significant psychological dimension. If erections are unreliable across all contexts, physical causes become more likely. In practice, many men have both: an underlying physical factor that makes erections slightly less reliable, layered with anxiety about that unreliability that makes it worse.
What Actually Helps
PDE5 inhibitors, the class of medication that includes sildenafil (Viagra) and similar drugs, work by enhancing the natural blood-flow mechanism that produces an erection. They do not create arousal from nothing; they make the physical response more robust when arousal is present.17PubMed Central. SILDENAFIL-ORAL MEDICATION FOR ERECTILE DYSFUNCTION-A REVIEW For many men, especially those with mild to moderate vascular causes, these medications are effective and safe. They can also break the anxiety cycle by providing a few successful experiences that rebuild confidence.
For psychological causes, structured approaches exist beyond just “relax and stop worrying about it,” which is advice that has never helped anyone. The European Society of Sexual Medicine endorses techniques like sensate focus, a graduated series of exercises that begin with non-genital touching and deliberately avoid pursuing arousal or penetration. The idea is to decouple physical pleasure from performance pressure. Over time, as a man learns to stay present in his body rather than monitoring himself, genital contact and penetration are reintroduced gradually.18PubMed Central. A Psychosocial Approach to Erectile Dysfunction: Position Statements from the European Society of Sexual Medicine (ESSM) This kind of structured therapy is most effective when a partner is involved and both people understand the process.
Lifestyle changes sound boring but carry real weight. Regular cardiovascular exercise improves endothelial function, the same mechanism that PDE5 inhibitors target pharmacologically. Losing excess weight, managing blood sugar, reducing alcohol intake, and quitting nicotine all address root causes rather than masking symptoms. If sleep apnea is a factor, treating it with CPAP or similar devices can improve erections as a downstream benefit.
When to See a Doctor and What to Expect
One bad night does not require medical attention. Fatigue, stress, alcohol, distraction, and the simple reality that human bodies are not machines all cause occasional erection loss that resolves on its own. The threshold for seeking help is when the problem is consistent, causing distress, or accompanied by other symptoms like reduced desire, pain, or changes in urination.
A doctor will typically ask about the pattern of the problem, your medications, your health history, and your psychological state. Blood work to check testosterone, blood sugar, cholesterol, and thyroid function is standard. A physical exam may include checking blood pressure and examining the genitals. Depending on the picture, you may be referred to a urologist for further evaluation, a cardiologist if vascular risk factors are prominent, or a therapist if the psychological component seems dominant. Many men delay seeking help out of embarrassment, which is understandable but unfortunate. The evaluation itself is usually straightforward, and the earlier you address the problem, the more options you have and the less entrenched any anxiety cycle becomes.
For men whose difficulties turn out to be the first sign of cardiovascular risk, as the research on endothelial dysfunction suggests is common, the evaluation may end up being more important for your long-term health than for your sex life alone. Getting checked is not just about erections. It is about catching problems while the window for prevention is still open.