Apple Inc. (NASDAQ: AAPL) is buying the struggling cellular modem unit of (Intel NASDAQ: INTC), bringing on key engineering talent and patents that will allow the technology giant to more quickly develop crucial components to connect its devices to the mobile Internet.

The deal is valued at $1 billion, Intel and Apple said in joint announcement. Intel sought to shed the unit because Chief Executive Officer Bob Swan decided it was costing the chipmaker too much money to support just one customer, which is Apple. The deal will give Apple 2,200 new employees and now a total holding of 17,000 wireless patents, the companies said.

Apple has been using Intel modems exclusively in iPhones since last year. But after having settled its long-standing royalties lawsuit with Qualcomm Inc. in April, it will go back to using that company's 5G cellular modems for future versions of products like the iPhone. Qualcomm was the first to offer such technology at a mass scale and was on track to have its second-generation chip in the market before Intel released its first. Eventually, Apple wants to shed all third-party partners and bring modem production in-house, a move that the deal with Intel should help expedite.

"Apple is excited to have so many excellent engineers join our growing cellular technologies group, and know they'll thrive in Apple's creative and dynamic environment," Johny Srouji, Apple's senior vice president of hardware technologies, said in a statement. "They, together with our significant acquisition of innovative IP, will help expedite our development on future products and allow Apple to further differentiate moving forward."

Swan said that Intel has "long respected Apple" and that he's "confident they provide the right environment for this talented team and these important assets moving forward." Although Intel is selling the modem unit to Apple, the company said it still holds the right to build modems for non-phone devices like computers, home products and self-driving cars.

The deal is scheduled to close in the fourth quarter. Intel said that Goldman Sachs served as its financial adviser.

Apple has been working on its own modem technology for the past couple of years and has established development centers, including in San Diego, a hotbed for modem development and Qualcomm's backyard, to support the effort. In recent months, Apple has been ramping up hiring from Intel and Qualcomm to work on 5G modems.

Earlier this year, before settling with Qualcomm, Apple re-located its modem engineering team, moving it from the main hardware-engineering group under longtime vice president Ruben Caballero, into the hardware-technologies division led by Srouji. Caballero has since left the company. The settlement with Qualcomm helps Apple in part to be able to bring a 5G iPhone to market next year after Intel missed deadlines and featured inferior performance, according to people familiar with the series of events.

By planning to develop its own modems, Apple will not need to rely on a third-party designer for such a key part. Selling its own modems would follow the long-time Apple playbook, which is to design critical components internally. Apple already designs the main processors for its mobile devices and eventually plans to do the same for Mac computers. The company also built its own graphics engines, wireless chips and is exploring custom batteries and screens.

The deal with Intel is similar to one struck by Apple to pay Dialog Semiconductor Plc. $600 million for its power management business, the provider of another key component for Apple's devices.