Surgery for erectile dysfunction (ED) isn't common, but it may be the best treatment in some cases. During surgery, your doctor places an implant (also called a prosthesis) inside the spongy chambers of your penis. Then, the implant can be used to provide an erection.