In 1998, the Food and Drug Administration (FDA) approved Viagra, the first medication to treat ED. Viagra works by helping the blood vessels in your penis relax to allow more blood flow.