The 21-year-old recipient, whose identify is being protected, lost his penis in a botched circumcision.
Doctors in Cape Town said the operation was a success and the patient was happy and healthy.
The team said there was extensive discussion about whether the operation, which is not life-saving in the same way as a heart transplant, was ethical.
There have been attempts before, including one in China. Accounts suggested the operation went fine, but the penis was later rejected.
The man was 18 and already sexually active when he had the circumcision.
The procedure is part of the transition from boyhood to adulthood in parts of South Africa.
The boy was left with just 1cm of his original penis.
Doctors say South Africa has some of the greatest need for penis transplants anywhere in the world.
Dozens, although some say hundreds, of boys are maimed or die each year during traditional initiation ceremonies.