Anthem, one of the nation’s major health insurance companies, said on Wednesday that it planned to start its own business to manage prescription drug plans by partnering with CVS Health, the large pharmacy benefit manager and drugstore chain.

The insurer is in the midst of a bitter legal battle with Express Scripts, its current pharmacy benefits manager, over claims that Anthem has been overcharged. The insurer said it will start the new business in 2020 after its contract with Express Scripts expires, estimating the savings from the new arrangement to be about $4 billion a year, the bulk of which it said would flow to customers in the form of lower drug costs.

As pharmaceutical costs soar, pharmacy benefits managers, which serve as intermediaries between drug companies and the prescription plans, are coming under increasing criticism. The deals the managers strike with drug manufacturers are typically secret, making it hard to know what prices the companies are actually charging. The managers have come under fire for not doing enough to control costs.

Joseph R. Swedish, Anthem’s chief executive, said in a telephone interview on Wednesday, “This new partnership allows us to better secure control of the escalating cost” of prescription drugs.