The 20 states where Walgreens won't sell mifepristone include some where abortion remains legal. It's not clear whether other retail pharmacies will follow suit.
The suit comes as a federal judge in another case is considering whether to overturn FDA approval of the same drug, mifepristone.
CVS would pay about $5 billion and Walgreens more than $5.5 billion, though neither company has admitted wrongdoing. States have until the end of the year to accept the terms of the settlement.
Payouts will be spread over the next 18 years, with much of the funding going to help communities struggling with high rates of opioid addiction and overdose deaths.
A bipartisan group of 38 attorneys general say Google abuses its power as the Internet's top search destination.
Twin complaints from the Federal Trade Commission and 48 attorneys general paint a portrait of a company protecting its power at all costs.