Settling allegations of discrimination filed by the Massachusetts attorney general’s office, Mutual of Omaha has agreed not to deny insurance to people who use medications to prevent H.I.V. infection.

The insurer also has settled a lawsuit brought by an unidentified gay man in Massachusetts who was turned down for long-term-care insurance after acknowledging that he took an H.I.V.-prevention drug called Truvada.

“Consumers looking to protect themselves from H.I.V. transmission should not be excluded from buying insurance,” Maura Healey, the attorney general of Massachusetts, said in a prepared statement.

The company admitted no wrongdoing in the settlements and will make a $25,000 payment to the state.

Mutual of Omaha became the focus of discrimination complaints after applicants, mostly gay men, said they were denied disability, long-term-care or life insurance solely because they were taking Truvada to protect themselves from H.I.V., a practice called PrEP (short for pre-exposure prophylaxis).