E-commerce giant Amazon and business software maker Salesforce are the latest U.S. technology companies to announce major job cuts as they prune payrolls that rapidly expanded during the pandemic lockdown.

Amazon said Wednesday that it will be cutting about 18,000 positions. It’s the largest set of layoffs in the Seattle-based company’s history, although just a fraction of its 1.5 million global workforce.

“Amazon has weathered uncertain and difficult economies in the past, and we will continue to do so,” CEO Andy Jassy said in a note to employees that the company made public. “These changes will help us pursue our long-term opportunities with a stronger cost structure.”

He said the layoffs will mostly impact the company’s brick-and-mortar stores, which include Amazon Fresh and Amazon Go, and its PXT organizations, which handle human resources and other functions.

In November, Jassy told staff that layoffs were coming due to the economic landscape and the company’s rapid hiring in the last several years. Wednesday’s announcement included earlier job cuts that had not been numbered. The company had also offered voluntary buyouts and has been cutting costs in other areas of its sprawling business.

Salesforce, meanwhile, said it is laying off about 8,000 employees, or 10% of its workforce.

The cuts announced Wednesday are by far the largest in the 23-year history of a San Francisco company founded by former Oracle executive Marc Benioff. Benioff pioneered the method of leasing software services to internet-connected devices — a concept now known as “cloud computing.”

The layoffs are being made on the heels of a shake-up in Salesforce’s top ranks. Benioff’s hand-picked co-CEO Bret Taylor, who also was Twitter’s chairman at the time of its tortuous $44 billion sale to billionaire Elon Musk, left Salesforce. Then, Slack co-founder Stewart Butterfield left. Salesforce bought Slack two years ago for nearly $28 billion.

Salesforce workers who lose their jobs will receive nearly five months of pay, health insurance, career resources, and other benefits, according to the company. Amazon said it is also offering a separation payment, transitional health insurance benefits, and job placement support.

Benioff, now the sole chief executive at Salesforce, told employees in a letter that he blamed himself for the layoffs after continuing to hire aggressively into the pandemic, with millions of Americans working from home and demand for the company’s technology surging.

“As our revenue accelerated through the pandemic, we hired too many people leading into this economic downturn we’re now facing, and I take responsibility for that,” Benioff wrote.

Salesforce employed about 49,000 people in January 2020 just before the pandemic struck. Salesforce’s workforce today is still 50% larger than it was before the pandemic.

Meta Platforms CEO Mark Zuckerberg also acknowledged he misread the revenue gains that the owner of Facebook and Instagram was reaping during the pandemic when he announced in November that his company would by laying off 11,000 employees, or 13% of its workforce.

Like other major tech companies, Salesforce’s recent comedown from the heady days of the pandemic have taken a major toll on its stock. Before Wednesday’s announcement, shares had plunged more 50% from their peak close to $310 in November 2021. The shares gained nearly 4% Wednesday to close at $139.59.

“This is a smart poker move by Benioff to preserve margins in an uncertain backdrop as the company clearly overbuilt out its organization over the past few years along with the rest of the tech sector with a slowdown now on the horizon,” Wedbush analyst Dan Ives wrote.

Salesforce also said Wednesday that it will be closing some of its offices, but didn’t include locations. The company’s 61-story headquarters is a prominent feature of the San Francisco skyline and a symbol of tech’s importance to the city since its completion in 2018.