After several months of turbulent negotiations, New York state regulators have approved the acquisition of the health insurer Aetna by the retail pharmacy chain CVS Health. That approval, however, was contingent with a promise from the companies to absorb the cost of the merger without passing it on to consumers and to pay the state $40 million for health care-related activities.

The approval comes after Maria Vullo, the superintendent of the state Department of Financial Services, suggested last month that her agency could choose to block the deal over concerns that CVS would pass on the cost of the merger to policyholders and customers.