Sildenafil is the generic versions of Viagra®, an oral tablet prescription medication used to treat erectile dysfunction (ED). Sildenafil works by increasing blood flow to the penis to help a man get and keep an erection. Onset is typically within 20 minutes and lasts for about 2 hours.