The man visited a hospital in northeastern India last month, claiming he had ingested some earphones, said Dr. Walliul Islam, a general surgeon at the hospital.
But when the cord didn't appear despite the patient being prescribed laxatives, doctors resorted to surgery.
"He came to us after five days, (and) despite passing stool several times the cable did not come out. We then conducted an endoscopy but still couldn't find anything. As the patient complained of severe pain, we decided to perform surgery and found that there was nothing in his intestine," Islam told CNN.
MORE: Man's missing dentures were found stuck in his throat 8 days after surgery
It was at that point that an x-ray revealed the man to have a two-foot-long charging cable in his bladder -- inserted via his urethra, the tube that leads from the penis to the bladder.
"Then I made an incision there and took out the cord, which was actually a charging cable over 2 feet long," Islam said.
"If he had been honest then it would have saved us the trouble and we could have treated him sooner."
The patient has been discharged and is fine, according to Islam.
"I have read that people used to get sexual gratification by inserting instruments through the penis. This is one such case, and the psychiatrist can help him beyond this point," Islam added.
MORE: Mom rushes 7-year-old son to ER after he swallows AirPod
MORE: Woman has surgery after dreaming she swallowed ring, waking up to discover she actually did