Apple was up less than 1%. Intel , a Qualcomm competitor, sharply dipped on the news before recovering.

Qualcomm stock rose more than 20% after the news broke, boosting its market cap by about $14.5 billion to more than $84 billion. It's Qualcomm's best day since 1999.

The settlement includes a payment from Apple to Qualcomm as well as a chipset supply agreement, suggesting that Apple will buy Qualcomm chips for future iPhones. The companies did not say how much the payment will be.

Apple and Qualcomm have settled their royalty dispute, the companies announced in a press release .

Qualcomm took off following a Tuesday announcement it had reached a settlement agreement with Apple. The company gained billions in market cap as a result.

Qualcomm expects incremental earnings per share of $2 as product shipments ramp, the company said.

"This was a major win for Qualcomm as fears of a loss in the courts was a major overhang on the name with Apple going after this IP issue full steam ahead," Wedbush Securities analyst Dan Ives said. "A settlement is a surprise to investors as ultimately Apple realized this was more about two kids fighting in the sandbox and they have bigger issues ahead with 5G and iPhone softness rather than battling Qualcomm in court."

The two companies started proceedings in a trial in federal court in San Diego on Monday, which was expected to last until May. Both sides were asking for billions in damages. The antitrust case was originally filed by Apple in early 2017.

The complicated legal battle, centered around modem chips and related disputes, has been raging in courts around the world for the past two years, including an earlier trial between Qualcomm and the U.S. Federal Trade Commission.

For years, Apple bought modem chips from Qualcomm, but it chafed under Qualcomm's prices and requirement that any company using its chips would also pay licensing fees for its patents.

Apple argued that Qualcomm was abusing its position as one of the only suppliers for cellular technology, and Qualcomm contended that Apple was withholding payments that the two companies had hammered out as part of a royalty agreement.

According to Qualcomm, the new license between the two companies is six years, with a two-year option to extend. It includes a one-time payment from Apple to Qualcomm. The amount of the payment was not disclosed.

In November, Qualcomm CEO Steve Mollenkopf said that he believed that the two companies were on the "doorstep" to settling. Apple CEO Tim Cook contradicted him shortly after, saying that Apple hasn't been in settlement discussions since the third calendar quarter of 2018.

New iPhone models released in 2018 used Intel modem chips instead of Qualcomm's technology.

Analysts had previously said that the dispute between Qualcomm and Apple could slow down Apple's plans to support next-generation 5G networks. Qualcomm is one of the top suppliers of chips that can connect to 5G networks. The agreement opens up the possibility that Apple could release a 5G iPhone sooner than expected with Qualcomm's modem technology.

Here is the full press release:

Qualcomm and Apple® today announced an agreement to dismiss all litigation between the two companies worldwide. The settlement includes a payment from Apple to Qualcomm. The companies also have reached a six-year license agreement, effective as of April 1, 2019, including a two-year option to extend, and a multiyear chipset supply agreement.

WATCH: How Qualcomm became a chip giant and why its business model is being challenged by Apple and the FTC