His team is working on ways to minimize or even eliminate the need for anti-rejection medicines, which transplant patients typically have to take. That research is especially important for veterans, he said, because many are young and will risk serious adverse effects, like cancer and kidney damage, if they have to take the drugs for decades.

From 2001 to 2013, 1,367 men in the military suffered so-called genitourinary injuries in Iraq or Afghanistan, according to the Department of Defense Trauma Registry. Nearly all were under 35 and had been hurt by homemade bombs, commonly called improvised explosive devices, or I.E.D.s. Some lost part or all of their penises.

The Massachusetts General team spent three years preparing for the penis transplants. The team did meticulous dissections in a cadaver lab to map out anatomy, and operated on five or six dead donors to practice removing the tissue needed for the transplants. Mr. Manning’s operation involved about a dozen surgeons and 30 other health care workers.

Dr. Dicken Ko, a team leader and the director of the hospital’s regional urology program, said the team had not planned a set number of transplants. Instead, he said, the hospital will evaluate candidates one at a time and decide whether to allow surgery. For now, he said, the transplants will be limited to cancer and trauma patients, and will not be offered to transgender people.

An accident at work in 2012 brought Mr. Manning to the hospital, and ultimately to the transplant team. Heavy equipment had fallen on him, causing severe injuries. The doctors treating him saw an abnormal growth on his penis that he had not noticed.

Tests revealed an aggressive and potentially fatal cancer. Penile cancer is rare, with about 2,030 new cases and 340 deaths expected in the United States this year.