Yahoo is taking a 350 million dollar hit on its previously announced 4.8 billion dollar sale to Verizon in a concession for security lapses that exposed personal information stored in more than one billion Yahoo user accounts.
The revised agreement, announced on Tuesday, eases investor worries that Verizon Communications would demand a discount of at least one billion dollars or cancel the deal entirely.
The hacking bombshells, disclosed after the two companies agreed on a sale, represent the two biggest security breaches in internet history.
The breaches raised concerns that people might decrease their use of Yahoo email and other digital services that Verizon is buying.
A smaller audience makes Yahoo's services less valuable because it reduces the opportunities to show ads - the main reason that Verizon struck the deal seven months ago.
Yahoo has maintained that its users have remained loyal, despite any mistrust that might have been caused by its lax security and the lengthy delay in discovering and disclosing the hacks.
The separate attacks occurred in 2013 and 2014; Yahoo disclosed them last September and December.
The lower price, now pegged at 4.48 billion dollars, will cost Yahoo shareholders roughly 37 cents per share.
But they may also be responsible for substantial legal costs.
After the Verizon deal closes, any future bills stemming from the hack will be shouldered by Altaba - a company that will become the caretaker of Yahoo's remains, which will include about seven billion dollars in cash and lucrative stakes in Chinese e-commerce giant Alibaba Group and Yahoo Japan.
Altaba will be responsible for all costs stemming from shareholder lawsuits and a Securities and Exchange Commission probe into how Yahoo handled the disclosure of the massive hacks.
Verizon and Altaba will split costs from all other hack-related lawsuits and government investigations.
This agreement "provides protections for both sides" and should help the deal close by the end of June, Marni Walden, Verizon's head of product innovation and new businesses, said in a statement.
Yahoo shareholders have to approve it.
Avoiding an even larger reduction in the deal value represents a small victory for Yahoo chief executive Marissa Mayer, who had already been under fire on Wall Street for her inability to turn around the company and then for the humiliating security lapses that came under her watch.
"Yahoo had to get this deal done. There is no better fit for them than Verizon," said Doug Melsheimer, managing director for Bulger Partners, an investment banking firm specialising in technology.
Ms Mayer, 41, is widely expected to step down after Verizon takes over, although she has not spelled out her plans definitively.
If she departs, Ms Mayer will leave with a severance package that was valued at 44 million dollars last summer.
The package is probably worth even more now because it primarily consists of Yahoo stock, which has risen by nearly 20% since last summer.
Verizon's willingness to accept some of the lingering risks from Yahoo's security breaches underscores the wireless carrier's desire to become a bigger player in the digital advertising market.
Google and Facebook currently dominate, but Verizon believes there is room to grow.
Because most people already have smartphones, wireless carriers such as Verizon have turned to price cuts and promotions to lure customers from each other.
Under pressure, Verizon even restored unlimited data plans this month, robbing it of revenue from monster-size data plans.
Instead, Verizon is trying to make money out of the hours people spend gazing at their phones.
It bought AOL for 4.4 billion dollars in 2015 for its advertising technology.
Verizon now wants to bolster that with Yahoo's technology, as well as its many users and popular websites devoted to sports, finance, entertainment and news.
"It has made sense for AOL and Yahoo combined for a very long time," Mr Melsheimer said.
"It has just been a very long route getting there."