In one of the biggest tech mergers of all time, Microsoft said Monday that it's buying LinkedIn in a deal valued at $26.2 billion.

It's Microsoft's largest acquisition ever and is not coming cheap.

Microsoft (MSFT) is paying $196 per share in an all-cash deal. That's 50% more than LinkedIn stock's closing price at the end of the day on Friday.

The deal combines Microsoft, which dominates the global market for computer systems, with LinkedIn, known as the main social network for professionals.

Microsoft wants to use LinkedIn as a database of professional information and distribution channel for its software systems. LinkedIn gains additional financing and access to millions of people who could potentially join its network.

Together, the two companies could build new types of services that would be particularly useful for workers in sales and HR roles, according to Rodney Nelson, lead Microsoft analyst at Morningstar.

A sales rep could look up someone he's pitching to through Outlook and see their LinkedIn information while writing an email pitch. In the future, Microsoft might even deploy Cortana as a virtual assistant to write the email too, based on that LinkedIn data.

For HR professionals, Microsoft could integrate LinkedIn work history of interested candidates to determine compensation offers and job placement.

Related: Hackers selling 117 million LinkedIn password

LinkedIn had a long, multi-year run as the best-performing social network in the stock market. But over the past six months, despite still being a sizable business, shares have started to sink as Facebook (FB) has soared.

LinkedIn (LNKD) had $3 billion in revenue last year, up 35% from the year before. It has 433 million members worldwide, but its growth has been slowing.

Shares had plunged 42% this year, before the deal was announced. The big spark came in February when the company warned of disappointing revenue and profits ahead.

The stock had previously traded at a very high price, relative to how much it was expected to earn. Why? Investors assumed that growth would continue at a break-neck pace, and the more dour growth forecast sent shares plunging.

Scott Kessler, an analyst at S&P Global Capital, says he's skeptical of the transaction because it's a "large deal at a premium with a lot of work to be done."

Related: LinkedIn switching to 'discretionary' vacation policy

The LinkedIn brand will continue after the deal is closed later this year, the companies said. Jeff Weiner will remain CEO of LinkedIn, reporting to Microsoft CEO Satya Nadella.

"The LinkedIn team has grown a fantastic business centered on connecting the world's professionals," Nadella said. "Together we can accelerate the growth of LinkedIn, as well as Microsoft Office 365."

This is set to be the 5th largest tech deal ever. It is dwarfed by the $67 billion purchase of EMC (EMC) by Dell announced last year, which has yet to close.

At the same time, the Microsoft deal values LinkedIn at significantly more than Yahoo (YHOO), which is weighing bids believed to priced the company's core business at less than $10 billion.

Reid Hoffman, the cofounder and chairman of LinkedIn who is also the company's controlling shareholder, will get $2.9 billion for the sale of his shares. The jump in LinkedIn shares early Monday lifted his net worth by more than $900 million.

Though there had been some speculation that Microsoft would make a large scale acquisition within the next 12 months, LinkedIn was not on investors' short list of guesses.

"I don't think anyone was expecting this particular news," said Nelson of Morningstar.

The surprise deal helped renew hope that another struggling social network -- Twitter -- might be sold too. Shares of Twitter (TWTR) popped as much as 6% after the Microsoft-LinkedIn acquisition was announced.