Negotiations between flash memory giants Sandisk ( SNDK) and Samsung end in tears -- tears of joy, that is.

Sandisk shares surged 17% Wednesday after the company struck a much lower-cost technology licensing agreement with Samsung.

Majestic Research analyst Rick Klugman highlighted the key sentence in the joint press release that helped spread glee among Sandisk investors.

"The estimated effective rate of the fixed payments and royalties is expected to be approximately half of the effective rate in recent years under the current license," according to the press release.

That's a positive surprise, Klugman wrote in a research note Wednesday.

"Investors were expecting a substantial reduction in the license terms upon renewal, though not necessarily a 50% cut," Klugman wrote.

The agreement was set to expire in August and was at the center of a hostile takeover bid by Samsung and a bitter rebuff by Sandisk. Samsung had offered $26 a share to acquire Sandisk amid a collapse in the flash memory market. Sandisk felt the offer undervalued the company and rejected it.

A few months later, Sandisk's business continued to fall apart, causing the company to miss earnings targets, lower its forecast and announce a 20% dilutive stock sale to try and raise cash.

Rival Toshiba may or more likely may not have been interested in acquiring Sandisk in March, but the speculation may have forced Samsung to negotiate more favorably with Sandisk.

Flash memory cards are a common component in mobile phones, cameras and portable media players. They are also a key technology in new generation notebooks and so-called netbooks.

"We are very pleased with the agreements announced today. We believe that they represent good value for our stockholders and enable both parties to focus on the growth markets at hand," CEO Eli Harari said in a press release.

For Samsung's part, chip chief Oh-Hyun Kwon said in the release: "The renewal agreements enable Samsung and SanDisk to each focus their energies on restoring flash market growth."

The two companies have planned a press conference for 5:30 pm EDT Wednesday.

More from Technology

Nvidia Wipes Nearly $25 Billion From Its Market Cap After Earnings Day Disaster

Nvidia Wipes Nearly $25 Billion From Its Market Cap After Earnings Day Disaster

Nvidia Shares Tank as Analysts Cut Price Targets

Nvidia Shares Tank as Analysts Cut Price Targets

Facebook Stock Slides Another 3% as Woes Continue

Facebook Stock Slides Another 3% as Woes Continue

Hulu vs. Netflix: Which Is Better in 2018?

Hulu vs. Netflix: Which Is Better in 2018?

Facebook Needs a Management Shake-Up to Restore Credibility, Analyst Says

Facebook Needs a Management Shake-Up to Restore Credibility, Analyst Says