LOS ANGELES — Ailing 95-year-old media mogul Sumner Redstone has settled a series of lawsuits with an ex-girlfriend days before a trial was to begin.

Redstone’s attorney, Robert Klieger, said Tuesday that Manuela Herzer will return $3.25 million Redstone had given her and relinquish any claim on his estate.

Redstone, the majority shareholder of CBS, said he had given Herzer tens of millions of dollars. The legal fight had centered on whether Redstone was able to testify and make decisions for himself.