Two drug companies have agreed to a $54 million settlement in San Francisco’s opioid trial on Tuesday, just as closing arguments were set to begin.

Allergan, part of AbbVie, and Teva, both manufacturers of the prescription painkillers, will provide the city and county of San Francisco $34 million in cash payments and $20 million worth of the overdose reversal drug, Narcan. Closing arguments in the trial, which began on April 25 and has been livestreamed on the court’s website, continue on Tuesday against a third defendant, Walgreens.