The spectacle of Apple Inc. and Qualcomm Inc. continuing to have at it in court just vanished, seemingly because Apple has to seriously get down to the business of releasing its first 5G iPhone this year.

In an unexpected development Tuesday, both tech giants agreed to settle all ongoing lawsuits, putting an end to a legal drama spanning the globe where each company won some and lost some. For the past two years, Apple and Qualcomm have been battling over Qualcomm’s patent licensing practices.

Apple said the settlement ends all ongoing litigation between both companies, including with Apple's contract manufacturers. It noted that all companies involved have reached a global patent license agreement and a chipset supply agreement.

The legal ceasefire likely means Apple can now advance the release date of its first 5G iPhone it originally planned for 2020. Qualcomm has a product Apple desperately needs: really fast 5G modems.

Even if it does issue its first 5G iPhone this year, bragging rights for the first ever 5G phone to make it to market goes to Samsung. Samsung’s S10 5G was revealed April 5 to coincide with South Korea activating the world’s first 5G network.

“While a stock 5G Qualcomm modem might be able to get into a 2019 iPhone, it is more likely that Apple adds their own custom features to a Qualcomm 5G modem for a 2020 iPhone,” said Tim Bajarin, Creative Strategies tech analyst an avid Apple watcher

“For consumers this is important. Apple can stay competitive and give their customers a 5G experience no later than 2020. It also means that Qualcomm and Apple can be more aggressive in helping drive 5G innovation in the new decade.”

Apple will pay Qualcomm an undisclosed amount (likely in the billions of dollars) as part of the settlement. Both firms agreed to a six year-long global patent licensing agreement beginning April 1, 2019, including a two-year option to extend, and a multiyear chipset supply agreement.

They’ve also agreed Qualcomm will supply parts to Apple for multiple years. This proviso likely means Apple will get its hands on Qualcomm’s 4G and 5G modems.

Analysts said the agreement means the two companies can return to business as usual, at least for the next six or more years. They also noted that both companies might have also wanted to avoid revealing their tech secrets publicly in court.

The settlement is bad news for Intel, whose chips currently run Apple’s latest iPhones. Apple, however, usually relies on two vendors for its modems.

iPhone X Apple might releasing its iPhone X Fold late. Pictured: Visitors inspect the new iPhone X R during an Apple special event at the Steve Jobs Theatre on September 12, 2018 in Cupertino, California. Photo: Justin Sullivan/Getty Images

The unexpectedness of the détente was underscored by the fact news of the settlement was revealed as lawyers for both firms were still reading their opening arguments about unpaid royalty rebates at a San Diego courtroom.

Qualcomm’s legal problems aren’t over, however. It awaits a judgment on the lawsuit brought against it by the U.S. Federal Trade Commission (FTC) in January. Qualcomm has been fined hundreds of millions of dollars over its monopolistic practices and anti-competitive behavior.

The Apple-Qualcomm legal battle began in 2017 when Apple sued Qualcomm for over $1 billion in unpaid royalty rebates, while also accusing Qualcomm of anti-competitive patent licensing practices.