The pharmacy giant Walgreens was once Theranos’s most prominent partner, lending a sheen of legitimacy to the blood-testing company even as it faced mounting scrutiny about the accuracy of its diagnostic technology. But the relationship—which Walgreens kicked off in 2010 with a party at its corporate headquarters, featuring one excitable executive singing a Theranos-themed rendition of John Lennon’s “Imagine”—quickly soured. Walgreens became frustrated that Theranos limited access to its labs, data, and devices, and was alarmed when Wall Street Journal reporter John Carreyrou began raising questions about the company’s blood-testing devices in 2015, prompting a number of federal investigations and civil lawsuits. Walgreens itself sued Theranos in 2016 for $140 million in damages, alleging that Theranos had misled the drugstore chain about the effectiveness of its devices, and about its legal and regulatory problems.

Now, Theranos has reportedly reached a settlement with Walgreens. But the agreement comes at a steep price for Theranos, which is hemorrhaging its cash reserves as it works to close a series of disputes and lawsuits with investors and partners. “Today we announced that Theranos has entered a confidential settlement agreement with Walgreens,” the company said in a statement Tuesday. “The agreement will result in the dismissal of Walgreens’ lawsuit against Theranos, with no finding or implication of liability.” A Walgreens spokesman told the Journal that “the matter has been resolved on mutually acceptable terms.”

While the Walgreens settlement reportedly cost Theranos more than $25 million, it is not clear how much of the money will be paid by the company itself, or when the payments might be made. The Journal notes that Theranos may have insurance policies to help cover lawsuits and settlement agreements. Still, between the Walgreens settlement and a series of other agreements Theranos has made with regulators and investors over the past year, the company’s cash reserves are dwindling. Earlier this year, the company settled with the Arizona attorney general and the main U.S. lab regulator, and reached an agreement with investor Partner Fund Management. Theranos reportedly had just $187 million in the bank in January, after burning through much of the nearly $700 million it had raised since its 2003 founding. In June, Theranos had told its investors it had $54 million and had been burning through about $10 million a month, now mostly on legal fees since cutting much of its staff from 900 employees to 170, though it would work to reduce its burn rate. Theranos put its Palo Alto headquarters up for rent last month

The downsizing process caps a remarkable arc for Theranos and its 33-year-old founder and C.E.O. Elizabeth Holmes, who became, at one point, the youngest self-made female billionaire in the world. For a number of years, Holmes held a singular position in the Silicon Valley firmament, lauded by the media as the second coming of Steve Jobs—an impression Holmes cultivated by mimicking the Apple co-founder’s sartorial style. Now, after nearly two years of scandals, Holmes is trying to rebuild Theranos as a smaller, more grounded company, free of the mythologizing and hyperbolic claims that were her downfall. “Over the past 16 months, the Company has built a new senior management team, changed the composition and structure of its Board of Directors, installed an expert technology and scientific advisory board, and implemented a new quality and compliance program,” Theranos said in a statement. “Theranos recently closed on a recapitalization of its recent investors, unifying their support as the Company moves toward commercializing its innovative technologies.”

Theranos, which was once valued at about $9 billion, is reportedly planning to ask some of its existing investors for about $50 million more in funding, a year after pivoting to the commercialization of its new miniLab platform. It remains to be seen who, if anyone, would put more money into the embattled company. But it seems Theranos will need the cash.