(Reuters) - Qualcomm Inc on Tuesday won a major victory in its wide-ranging legal dispute with Apple Inc as the companies reached a surprise settlement that called for the iPhone to once again use Qualcomm modem chips.

Shares of Qualcomm jumped 23 percent to $70.45 in regular trading, their biggest gain in more than 19 years, then hit $75.25 in after-hours trading.

Intel Corp, which had been Apple’s sole iPhone chip supplier for the past year amid intensifying conflict with Qualcomm, said hours after the settlement was announced that it would exit the modem chip business.

The Qualcomm settlement also incorporates a six-year patent license and a payment from Apple to Qualcomm, but the companies did not disclose the amount.

Because Qualcomm is already shipping 5G chips while Intel was still developing them, the deal helps Apple in its battle with Samsung Electronics Co Ltd and other manufacturers whose phones already work on the faster networks.

“This is a big win” for Qualcomm, said Christopher Rolland, an analyst at Susquehanna Financial Group.

The settlement followed two years of increasingly bitter legal battles between the two companies and came as opening arguments took place at a trial in federal court in San Diego.

Intel said Tuesday it was exiting the phone modem business and would focus its 5G efforts on other devices such as networking gear.

Shares of Intel were up 2.7 percent at $58.25 in after hours trade. Apple was barely changed after hours.

“Intel isn’t trading lower because modems represent such a small portion of revenues for the company,” said Patrick Moorhead of Moor Insights & Strategy.

The deal could help Qualcomm return to the preeminent position it held in the early 2010s when it dominated the transition to 4G mobile networks and expanded revenues dramatically.

Apple had accused Qualcomm of using illegal patent practices to keep a monopoly on modem chips that connect phones to mobile data networks. Qualcomm had said Apple was using its technology without paying for it.

Qualcomm and Apple did not say when their new supply agreement would start. Because Intel does not expect to have a 5G chip ready for phones until next year, Bernstein analyst Stacy Rasgon said Apple is most likely tapping Qualcomm for its 5G chip.

FILE PHOTO: An employee of German Apple retailer Gravis displays an iPhone 7 and 8 in a store in Berlin, Germany, January 3, 2019. REUTERS/Fabrizio Bensch/File Photo

Intel’s exit from the modem business does not necessarily mean Qualcomm will become Apple’s sole supplier. Apple executives testified in January at a trial between the U.S. Federal Trade Commission and Qualcomm that Apple’s policy is always seek several suppliers.

Moreover, during the FTC trial Apple executives disclosed they had held talks with Samsung and MediaTek Inc about possibly using their 5G modems for 2019 iPhones.

Apple this year also moved its modem engineering efforts into the same group that makes its proprietary chips, signaling that the iPhone maker is also seriously pursuing its own modem.

BOOST TO EARNINGS

Qualcomm said the arrangements are expected to generate $2 per share in additional earnings, though analysts cautioned it was not clear how much of that was coming from the license deal versus the supply agreement.

Analysts were also unsure whether Apple’s a onetime payment under the deal represented unpaid royalties from the past two years or a down payment on future royalties.

The settlement could also have an impact on China’s Huawei Technologies Co Ltd, which is also in a licensing dispute with Qualcomm. Analysts widely believe that Huawei was watching the outcome of the Apple case to gauge its bargaining position.

Finally, the U.S. FTC case against Qualcomm that makes many of the same claims of anticompetitive behavior remains unresolved, with a decision expected at any time.

A jury of six men and three women was in the process of hearing opening arguments from Apple and Qualcomm when news of the settlement broke.

In addition to the federal lawsuit, the companies had lodged litigation in dozens of jurisdictions around the world, including Qualcomm efforts to ban iPhone sales in Germany and China and a state court case in San Diego where Qualcomm accused Apple of helping steal its chip secrets to benefit Intel.

Apple filed a $1 billion lawsuit against Qualcomm in January 2017, accusing the chipmaker of overcharging for chips and refusing to pay some $1 billion in promised rebates.

Later Qualcomm hit back with its own lawsuit, alleging that Apple used its heft in the electronics business to wrongly order contract factories such as Hon Hai Precision Co Ltd’s Foxconn to withhold royalty payments from Qualcomm that Apple had historically reimbursed to the factories.

As part of the settlement, Qualcomm will also end litigation with Apple’s contract manufacturers.

Intel did not immediately respond to Reuters request for comment.