In the mid-1980s, he was at the center of a different testing controversy — about how extensively the military should test its members for AIDS and how it should use the test results it had compiled. Dr. Redfield advocated for widespread testing and tracking as the best way to prevent the infection’s spread, while others argued it was a way for the military to flush out or otherwise discriminate against gay members. Later, he was the subject of a military investigation after colleagues suspected that he overstated the therapeutic effects of an experimental AIDS vaccine; the investigation led to a correction in some published data, but no evidence of misconduct was found.

He retired from the Army in 1996 to co-found the Institute of Human Virology at the University of Maryland School of Medicine, where the goal is to discover and distribute treatments for chronic viral and immune disorders, especially H.I.V. When Dr. Redfield left the institute, his co-founder, Dr. Robert C. Gallo, called him a major force in establishing programs to confront the H.I.V. and hepatitis C epidemics in Baltimore and around the state.

He is credited with helping the institute increase its patient base to 6,000 in Baltimore and Washington, and to more than 1.3 million in Africa and the Caribbean, where he also helped with the medical response in Haiti after the 2010 earthquake. He formed close relationships with patients, and kept photos of some who died of AIDS in his early days at Walter Reed in his office for years.

In his first two years leading the C.D.C., Dr. Redfield helped persuade Mr. Trump to take on the ambitious goal of ending transmission of H.I.V. in the country by 2030, through expanded efforts to prevent infections and treat those with the virus. And he has been a vocal champion of efforts to address opioid addiction and overdose, even sharing with the nation that one of his own sons had nearly died of an overdose and that the family struggled to find him treatment.

Dr. Redfield’s initial compensation at the C.D.C. caused an embarrassing controversy shortly after he took office. After earning about $650,000 a year at the University of Maryland, he was hired at an annual salary of $375,000, substantially higher than his predecessors and his boss, the secretary of health and human services, Alex M. Azar II.

The exceptional pay was granted under a federal provision that the Department of Health and Human Services can use to pay an official more than the approved government rate if the person provides a specific scientific need that otherwise cannot be filled. The department said this was a rare chance to hire a leading virologist.

But Dr. Redfield had actually sought the job for years. After Senator Patty Murray, Democrat of Washington, questioned the use of this exemption to pay him such a high rate, Dr. Redfield agreed to lower his salary to $209,700.