SEATTLE — Microsoft has made its most ambitious move in years to reassert itself in a technology market it once dominated.

The software giant said Monday morning that it would acquire LinkedIn in a $26.2 billion cash deal. The acquisition, by far the largest in Microsoft’s history, unites two companies in different businesses: one a big maker of software tools, the other the largest business-oriented social networking site, with more than 400 million members globally.

The deal is Microsoft’s biggest bet yet that the traditional software business is shifting quickly to cloud computing, a model in which customers rent software and other services delivered over the internet. While LinkedIn does not have the household name of Facebook, a much larger and more lucrative social network, it is the most widely used site for people to advertise their professional skills and work history.

It is also further evidence that Satya Nadella, Microsoft’s chief executive, sees the company’s future further and further removed from the PC software that once helped the company’s co-founder Bill Gates turn Microsoft into the world’s most valuable company.

Though they operate in different businesses, Microsoft and LinkedIn make most of their money by catering to professionals. Executives involved in the deal said that the common thread prompted the acquisition.

“This deal is all about bringing together the professional cloud and professional network,” Mr. Nadella said in a telephone interview.

So valuable is the data that recruiters spend thousands of dollars a month to use it to fill job openings.

“They know the interconnections of the business world,” said Brian Blau, an analyst at Gartner, a technology research firm. “That could really benefit Microsoft from a sales standpoint.”

Microsoft has bought its way into new businesses before, though most of its largest deals have not turned out well. In 2014, it paid nearly $9.4 billion for the smartphone operations of Nokia and some years earlier spent more than $6 billion for aQuantive, an internet advertising company, but ended up writing off most of the value of those deals after they performed poorly.

Mr. Nadella, who took over as chief executive in February 2014, was not involved in those deals. Since assuming leadership of the company, he has made mostly smaller acquisitions, with the exception of the $2.5 billion deal to acquire the maker of the game Minecraft.

Mr. Nadella said that when Microsoft pursued deals that hewed closer to a strict set of criteria, one of which is that the acquired company operates in areas that are core to Microsoft’s business, the deals have worked out.

“Every time we’ve gotten it right, we’ve had success in those dimensions,” Mr. Nadella said.

In a joint interview, Mr. Nadella and Jeff Weiner, the chief executive of LinkedIn, said that their conversations began in February, when the two began talking about different ways in which the companies could work together.

Mr. Weiner, for his part, said he began thinking about a LinkedIn combination with Microsoft long before he sat down with Mr. Nadella. He and Mr. Nadella first met a couple of years ago at a conference for chief executives at Microsoft’s headquarters.

“I’ve had a lot of admiration for the work Satya had done since taking over as C.E.O.,” Mr. Weiner said.

Microsoft was once a reviled company in Silicon Valley, where LinkedIn is based, but as its dominance in the industry ebbed it came to seem far less threatening.

Mr. Nadella has further improved Microsoft’s image in the technology industry by being more open to partnerships with once-bitter tech rivals like Salesforce.com. He has accelerated the company’s shift from traditional software to cloud applications and services, and its stock has risen significantly under his leadership.

And with more than $100 billion in cash and short-term investments as its disposal, Microsoft is an attractive suitor for companies that decide they are better off joining forces with a bigger entity.

Microsoft is paying considerably less for LinkedIn than it would have just last fall, when LinkedIn shares were trading over $260 a share. Disappointing earnings helped slash the value of the company. The deal calls for Microsoft to pay $196 a share to buy LinkedIn, a healthy premium to the $131.08 its shares closed at on Friday.

“This is a good time for LinkedIn to sell,” said Michael A. Cusumano, a professor at the Sloan School of Management at M.I.T. “They lost money last year. They’ve found it’s very expensive to keep growing. They’re probably as valuable as they will ever be.”

Image

Jeff Weiner, chief of LinkedIn, left, Satya Nadella, chief of Microsoft, and Reid Hoffman, executive chairman of LinkedIn, had dinner a few months ago and discussed details of how the LinkedIn-Microsoft deal would work.CreditMicrosoft

Microsoft could have acquired LinkedIn for even less a little over a decade ago. Microsoft held discussions with LinkedIn about acquiring it for $250 million, the venture capitalist and former LinkedIn executive, Keith Rabois, tweeted on Monday. Mr. Rabois confirmed in an email that LinkedIn was receptive to such a deal.

Yet big challenges remain for the company in today’s technology landscape, where new powerhouses like Amazon.com, the leader in cloud computing, have a significant head start.

LinkedIn could help Microsoft accelerate its shift to the internet by giving it a large online property that has became the de facto standard for posting résumés online. The site is heavily used by recruiters for finding new workers. Microsoft is one of LinkedIn’s biggest customers.

“The mission statements of LinkedIn and Microsoft have different words, but are essentially the same,” Mr. Weiner said. “We’ve come at it from different perspectives. LinkedIn built a professional network. Microsoft built a professional cloud.”

LinkedIn will give Microsoft access to a lot of potentially sensitive information that it will have to be careful about guarding — for example, when LinkedIn users are talking to job recruiters.

“The burden will be on them to put controls in place to ensure privacy is maintained,” said Dimitri Sirota, chief executive of BigID, a start-up that provides privacy management tools.

Microsoft was advised on the deal by Morgan Stanley and the law firm Simpson Thacher & Bartlett, while Qatalyst Partners, Allen & Company L.L.C. and the law firm Wilson Sonsini Goodrich & Rosati advised LinkedIn.

Microsoft’s courtship of LinkedIn began to heat up in April. Wary of Microsoft’s missteps with past acquisitions, the companies decided that allowing LinkedIn to operate independently was best.

Mr. Weiner will remain chief executive of LinkedIn, which will operate as an independent brand, following the lead of other technology acquisitions like Google’s purchase of YouTube and Facebook’s buy of WhatsApp.

In April, Mr. Nadella and Mr. Weiner had dinner to dig into details for how the deal would work, joined by Reid Hoffman, the co-founder and executive chairman of LinkedIn, and Qi Lu, a Microsoft executive who used to work at Yahoo with Mr. Weiner.

On Sunday night, the Microsoft and LinkedIn executive teams had a final meeting together at Mr. Hoffman’s house before the deal was announced. As a conversation starter, each participant had to share something with the group that was not on their personal LinkedIn profile.

A version of this article appears in print on , on Page B1 of the New York edition with the headline: Reasserting Muscle, Microsoft Buys LinkedIn. Order Reprints | Today’s Paper | Subscribe