The historical basis for understanding erectile function as a neurovascular phenomenon and the advance from fanciful to effective treatment of erectile dysfunction (ED) are reviewed, with emphasis on patients with cardiovascular disease (CVD). ED occurs in 60% of CVD patients by 40 years of age. Male ED and female sexual dysfunction (FSD) diminish quality of life and often warn of occult CVD. ED is often unrecognised but is readily diagnosed during a 5-minute interview using a truncated International Index of Erectile Function questionnaire. Erection of the penis and clitoral engorgement result from local, arousal-induced release of neuronal and endothelial-derived nitric oxide (NO). Arterial vasodilatation and relaxation of cavernosal smooth muscle cells cause arterial blood to flood trabecular spaces, compressing venous drainage, resulting in tumescence. Cyclic guanosine monophosphate (cGMP)-induced activation of protein kinase G mediates the effects of NO by enhancing calcium sequestration and activating large-conductance, calcium-sensitive K+ channels. Future treatment strategies will likely enhance these pathways. Phosphodiesterase-5 inhibitors (sildenafil, tadalafil and vardenafil) increase cGMP levels in erectile tissue. These agents are effective in 80% of CVD patients with ED and can be used safely, even in the presence of stable coronary disease or congestive heart failure, provided nitrates are avoided and patients do not have hypotension, severe aortic stenosis or evocable myocardial ischaemia. Second-line therapies (vacuum constrictor device and transurethral or intracavernosal prostaglandin E1) can also be used in CVD patients. Treatment of FSD and its relationship to CVD are less well established, but similarities to ED exist. ED can be prevented by reduction of CVD risk factors, exercise, weight loss and abstinence from smoking.