Raytheon, a massive U.S. defense contractor best known for manufacturing the Patriot missile defense system, has agreed to merge with industrial technology giant United Technologies in an all-stock deal, the two companies announced Sunday.

The combined company would be the second-largest U.S. aerospace company, behind Boeing.

The newly formed Raytheon Technologies would be combined with United's Collins Aerospace and Pratt & Whitney, both leading producers of jet engines and engine parts. It would not inherit United's Carrier air conditioner business or its Otis elevator company, which are being spun off under the terms of an earlier deal.

Raytheon has a plant in Fort Wayne, and United Technologies has operations in Huntington that have been part of its Carrier business.

In a phone interview Sunday evening, executives from both companies said the deal was driven by a desire to create a leading aerospace technology company using state-of-the-art hardware from the defense and commercial aviation industries. The combined company would employ more than 60,000 engineers, would have about 38,000 active patents and would have enough financial firepower to invest $8 billion each year in research and development, they said.

“This is bringing two great technology companies together to provide technology solutions to our aerospace and defense customers that nobody else could ever provide,” said United Technologies CEO Greg Hayes, who would lead the combined company as chairman and CEO in two years.

He added that the combination “is not about cost takeout or job loss in the U.S.,” noting that the company expects to hire about 20,000 people in the next year.

Raytheon CEO Thomas Kennedy, who would become chairman of the new company, said: “Technology is a foundation for the entire company, and then upon that we build a commercial business and a defense business.”

The deal is expected to close in early 2020, subject to regulatory approvals. The company would retain its headquarters in the Boston area.

Raytheon employs more than 500 people at its Fort Wayne plant, which manufactures command and control systems, including military radio systems.

United Technologies operates United Technologies Electronic Controls in Huntington, which had employed more than 700 production employees before the parent company moved those jobs to Mexico in 2017 and 2018. The Huntington operation had manufactured controls for heating, ventilation, air conditioning and refrigeration units. UTEC headquarters and its engineering and marketing departments remain in Huntington.

The merger would give Raytheon a sizable foothold in the commercial aerospace market for the first time in recent memory. Most of Raytheon's revenue comes from the Pentagon and U.S. intelligence agencies. After the merger, about half of its revenue would come from supplying parts and components to the commercial aviation market.

Pratt & Whitney, which operates as a subsidiary of United Technologies, builds the engines that power Airbus' A220, and A320neo and A380 commercial jets. And it is a dominant provider of military jet engines, building the supersonic jet engines that power F-15, F-16 and F-35 fighter jets.