The Food and Drug Administration has approved the first drug shown to reduce the risk of HIV infection, a milestone in the 30-year battle against the virus that causes AIDS.

The agency approved Gilead Sciences’ pill Truvada as a preventive measure for people who are at high risk of acquiring HIV, such as those who have sex with HIV-infected partners.

“Today’s approval marks an important milestone in our fight against HIV,” Margaret A. Hamburg, commissioner of the Food and Drug Administration, said today in a statement.

“Every year, about 50,000 U.S. adults and adolescents are diagnosed with HIV infection, despite the availability of prevention methods and strategies to educate, test, and care for people living with the disease. New treatments as well as prevention methods are needed to fight the HIV epidemic in this country.”

Gilead Sciences Inc. has marketed Truvada since 2004 as a treatment for people who are infected with the virus.

But company studies have shown the drug can prevent people from contracting HIV when used as a precautionary measure. A three-year study found that daily doses cut the risk of infection in healthy gay and bisexual men by 42 percent, when accompanied by condoms and counseling.

(The AP and Bloomberg contributed to this report.)