By Aaron Tilley

Salesforce.com Inc. agreed to buy messaging company Slack Technologies Inc. in a $27.7 billion deal that shows how the biggest players in cloud computing are racing to add muscle amid the pandemic's remote-work boom.

The cash-and-stock deal, announced Tuesday, is the biggest move yet by Salesforce Chief Executive Marc Benioff, a pioneer in selling subscriptions for software run on remote servers, to turn the company he co-founded 21 years ago into a broad-reaching powerhouse in tech tools for businesses. The deal is almost twice as large as Salesforce's largest acquisition so far and would turn the combined company into a more formidable competitor to Microsoft Corp. and Google parent Alphabet Inc. The Wall Street Journal previously reported Salesforce and Slack were in advanced deal talks.

The combination also brings together two of the tech industry's highest profile CEOs -- people who have made a career of taking on Silicon Valley icons. Mr. Benioff has positioned himself as a prominent voice in U.S. business, using venues like the World Economic Forum in Davos, Switzerland, to champion causes and burnish his profile. He set up Salesforce with a pledge of corporate giving and bought himself an even larger platform with his acquisition of Time Magazine two years ago.

Slack CEO Stewart Butterfield has been one of the loudest voices arguing that companies need to revamp how they use technology. He co-founded Slack, which grew out of a gaming company called Tiny Speck, and pitched its product as an alternative to office email. It quickly took off among developers in technology companies when it became publicly available in 2014. He is expected to join Salesforce and continue to run Slack as a unit of Salesforce after the deal's close, the companies said.

Salesforce's planned Slack acquisition is another sign that companies are betting some of the changes in the workplace in recent months will outlast the pandemic. "We really see the world as fundamentally having shifted," Salesforce operating chief Bret Taylor told analysts. "Slack is really the system of engagement for every employee, every partner and for every customer interaction."

The purchase, which still has to clear Slack shareholder and regulatory approval, would underpin Mr. Benioff's effort to move Salesforce beyond its core product, which helps companies manage their customer relationships, to providing the software tools that businesses need for a swath of their day-to-day operations.

The deal also opens a new front in Salesforce's battle with much larger rival Microsoft, which has been pushing to be the go-to software vendor for businesses, offering a range of applications from data storage to video communications. The Redmond, Wash., company introduced its Teams software suite in 2016 with Slack-like chat collaboration features.

"Together, Salesforce and Slack will shape the future of enterprise software and transform the way everyone works in the all-digital, work-from-anywhere world," Mr. Benioff saidt.

The software-services industry is rapidly growing. It is expected to top $140 billion in annual spending in 2022, up around 37% from last year's figure, according to research firm Gartner Inc.

Early in the pandemic, Microsoft Chief Executive Satya Nadella said businesses were overhauling how they operate. "We've seen two years' worth of digital transformation in two months," he told analysts.

Salesforce and Slack, both based in San Francisco have long competed with Microsoft. In 2016, Salesforce, after it lost out to its larger rival in buying LinkedIn Corp., urged regulators to examine the proposed deal on antitrust grounds. The transaction ultimately passed regulatory scrutiny. And this summer, Slack filed a complaint with the European Union over alleged antitrust behavior by Microsoft in using its market dominance to push Teams.

"They want to kill us," Mr. Butterfield has told the Journal.

Slack shareholders are due to receive $26.79 in cash and 0.0776 Salesforce share for each share of Slack stock. That equates to $45.52, based on Salesforce's closing share price Tuesday, or more than 50% above Slack's closing price the day before the Journal broke news of the talks last week. The $27.7 billion price tag is so-called enterprise value, which typically includes net debt, and is based on Salesforce's closing price Monday.

The companies said the deal is expected to close in Salesforce's fiscal year that begins in February.

Salesforce has been trying for years to expand into providing the kind of workplace collaboration tools Slack offers. In 2010, it launched a private social network, Chatter, to help companies to collaborate. In 2016, it bought cloud-document collaboration app company Quip Inc. for more than $500 million. Neither product has been meaningfully successful for Salesforce, according to analysts.

Slack went public last year through an unconventional method called a direct listing, in which the company simply floats its existing shares onto an exchange and lets the market determine the price without investment banks serving as gatekeepers.

Slack in recent months failed to spark the kind of investor excitement enjoyed by other business-software companies more closely associated with the boom in videoconferencing, such as Microsoft and Zoom Video Communications Inc.

During the pandemic, Microsoft has aggressively pushed its Teams software suite that includes Slack- and Zoom-like features. Its use grew to more than 115 million last month from 32 million daily active users at the beginning of the pandemic in March. Microsoft packages Teams free with its Office 365 suite.

Slack stopped updating its daily active user number late last year when it reached 12 million.

The Slack deal isn't the first time Mr. Benioff has spent heavily to expand Salesforce. Last year, the company made its biggest purchase before Slack, spending around $15 billion in stock for data-analytics platform Tableau Software Inc. And a year earlier, the company shelled out more than $5 billion in what was then its largest deal ever for MuleSoft to help customers connect data from across different systems.

Last year, Salesforce said it was seeking to reach $28 billion in annual sales in the 2023 financial year. It had $16 billion in sales in its most recent year, while Slack had $630.4 million in annual sales in its latest financial year. Salesforce's most immediate rivals are much bigger. Microsoft had $143 billion in annual sales and Google's parent had about $162 billion in revenue in the latest financial year, principally from its advertising business.

Like many big-ticket deals, this one comes with risks given the cost. Salesforce in 2016 bought cloud-document collaboration app company Quip Inc. for more than $500 million to expand the services it could offer. But the product hasn't attracted a wide following, according to analysts.

Salesforce and Slack have already been partners. But by owning Slack, Salesforce's Mr. Taylor said, Slack's software could become the main interface customers use to access Salesforce's wider tools.

Also Tuesday, Salesforce posted earnings for the quarter ended Oct. 31. The company reported sales of $5.42 billion in the period, up from $4.51 billion the year prior, generating net income of $1.08 billion. Wall Street expected sales of $5.25 billion and net income of $700 million, according to FactSet.

It lifted its full-year sales outlook to $21.10 billion to $21.11 billion. The high end of its earlier guidance was $20.8 billion. Sales next fiscal year should reach $25.45 billion to $25.55 billion, Salesforce said, including $600 million linked to Slack.

Slack also reported its fiscal third quarter results Tuesday, a week earlier than anticipated, in conjunction with the deal. It posted sales of $234.5 million and a net loss of $68.4 million compared with sales of $168.7 million and a net loss of $89.2 million for the year-ago quarter. Analysts were estimating $224.8 million in sales and a net loss of $86.2 million for the quarter, according to FactSet.

Salesforce worked with Bank of America Corp. as its financial adviser and got legal advice from Wachtell, Lipton, Rosen & Katz and Morrison & Foerster LLP. Slack's financial advisers were Qatalyst Partners LP and Goldman Sachs Group Inc., and Latham & Watkins LLP and Goodwin Procter LLP acted as legal counsel.

Write to Aaron Tilley at aaron.tilley@wsj.com

(END) Dow Jones Newswires

12-01-20 1950ET