(CNN) -- It was a horrific act that brought the boy to an operating room in Johns Hopkins Children's Center in Baltimore. A gang on the streets of Dhaka, Bangladesh, had cut off his penis and a testicle. He was only 7 at the time.
"As far as an injury committed by one person against another, to a child, this is the most severe genital injury that I've ever seen in 23 years of doing this," Dr. John Gearhart, a pediatric urologist, told CNN.
Gearhart and pediatric plastic surgeon Dr. Richard Redett volunteered their time to reconstruct the boy's penis.
Urologists in Bangladesh had done their best to preserve the boy's urethra -- the tube that connects the bladder to the tip of the penis -- so he could stand up while urinating. But scans from an MRI at Johns Hopkins showed very little penile tissue left around his injury.
Going into surgery, the doctors planned to reconstruct the penis's shape under a microscope using tissue from the boy's forearm, between his elbow and his wrist.
Everyone has two main arteries running into his or her hand, Redett explained. "You can take one of those arteries with a nice big piece of skin and fat and roll it into something that looks like a penis."
The surgery, Redett estimated, would take eight to 10 hours.
On August 16, more than a year after the attack, the surgeons opened up an area above the boy's scrotum to see if there was any usable penile tissue. It was then that they discovered some of the organ had contracted into his body after the amputation.
"The body heals by contraction," Redett said post-surgery. "So a wound anywhere on your body is going to heal by contracting in and getting smaller."
That meant the surgeons could pull out what was left of the boy's penis and use it to reconstruct the organ after removing any scar tissue.
To make it as realistic-looking as possible, Redett used skin from the boy's thigh for the shaft of the penis and tissue from his cheek lining to create the glans, or tip.
The boy's penis will grow at an average rate. "And even better than looking normal, it's going to function entirely normal," Redett said after the surgery.
If they had used tissue from the boy's forearm, the surgeons would have been able to reconstruct the shape, but not enable the penis to become erect.
"His male sexual hormones (would) be normal so he would have the urges and the sexual drives that any other young man would have, but he obviously couldn't perform," Gearhart said. "And that would be a terrible handicap for this child going forward as he becomes a young man."
By using the remaining organ that had contracted inside his body, the team was able to save some erectile tissue. Gearhart said this means the boy will not need an implant later to have a normal sex life and he should be able to father children.
Gearhart was most worried about sewing together the boy's small blood vessels -- one slip could cause unnecessary bleeding. But the surgery went smoothly, the team said, and they monitored him closely afterward for infections. In less than a week, the boy was out of the hospital and recovering across the street in a townhouse where his father was living temporarily.
Penile reconstruction surgery is most commonly performed after trauma, according to plastic surgeon Dr. Anthony Youn, who was not involved in the boy's case. But it is also performed after the organ is removed for cancer treatment, gangrene in the genital area, severe burns or necrotizing fasciitis, a flesh-eating bacterial infection. Similar surgery is done for gender reassignment surgeries.
CNN's Saeed Ahmed, Lisa Cohen and Sara Sidner contributed to this report.