For the quarter ended in July, the software firm reported non-GAAP diluted earnings of $1.44 a share as sales climbed 29% to $5.15 billion.
Analysts surveyed by FactSet were expecting adjusted earnings of 67 cents a share on sales of $4.9 billion.
Shares of Salesforce at last check were up 12%.
"It's humbling to have had one of the best quarters in Salesforce's history against the backdrop of multiple crises seriously affecting our communities around the world," said Salesforce Chief Executive Marc Benioff in a statement.
"Our success in the quarter brought all of this together with the power of our Customer 360 platform, the resilience of our business model, putting our customers first and doing our part to take care of all of our stakeholders."
Salesforce's subscription and support revenue for the second quarter came in at $4.84 billion, while professional services and other revenues were $310 million.
Looking ahead, Salesforce initiated guidance of between $5.24 billion and $5.25 billion for the current quarter.
For full fiscal 2021, it raised its outlook to between $20.7 billion and $20.8 billion, up 21% to 22% year over year. Its prior full-year guidance was $20 billion.
On Monday, the S&P Dow Jones Indices said Salesforce, along with Amgen AMGN and Honeywell HON, will join the price-weighted Dow Jones Industrial Average effective Aug. 31.
The three names are replacing Exxon Mobil XOM, Pfizer PFE and Raytheon RTX.
Salesforce shares were up 29% year to date heading into the earnings report.