Aetna has agreed to settle a lawsuit that accused the health insurer of discriminating against LGBTQ customers in need of fertility treatment.

Under the deal announced Friday, the insurer will make coverage of artificial insemination standard for all customers nationally and work to ensure that patients have equal access to more expensive in-vitro fertilization procedures, according to the National Women’s Law Center, which represented plaintiffs in the case.

Aetna, the health insurance arm of CVS Health Corp., covers nearly 19 million people with commercial coverage, including employer-sponsored health insurance.

The insurer will set aside a $2 million fund to reimburse people who had coverage from some of its commercial insurance plans in New York and were denied reimbursement for artificial insemination, a procedure in which sperm is placed directly in a woman’s uterus.

A CVS Health spokesman said the company was pleased to resolve the case and “committed to providing quality care to all individuals regardless of their sexual orientation or gender identity.”

A federal judge still must approve the deal.