NEW YORK — Wal-Mart laid off 450 workers at its headquarters Friday as the world’s largest retailer attempts to become more nimble so that it can better compete with the likes of Amazon.com.

There are more than 18,000 people who work at the headquarters in Bentonville, Arkansas, a close-knit community in northwest Arkansas. The cuts were across all areas, from finance to global e-commerce. The company says that the employees were spoken with individually early on Friday.

The layoffs follow months of rumors about them and they arrived less than two months after Wal-Mart trimmed its annual earnings outlook as profits fell. That is partly because of hefty investments Wal-Mart has made in e-commerce as well as higher wages for hourly workers.

A previous round of layoffs in Bentonville was announced in 2010 when 300 jobs were eliminated, but the latest marks the largest cuts since 2009, when the discounter laid off 800 employees as the U.S. emerged from recession.

While it is the behemoth of retail, Wal-Mart Stores Inc. is attempting to make changes that will allow it to “move with speed and purpose,” according to a memo sent by Wal-Mart CEO Doug McMillon to employees on Friday.

Wal-Mart is facing intense competition on all fronts, ranging from Amazon and dollar stores to the traditional grocery store chains that it has tried to challenge.

It is also trying to keep pace with the rapidly changing behavior of shoppers who are jumping back and forth between their smartphones and store aisles when shopping.

Wal-Mart’s U.S. business is undergoing a major overhaul in response. It’s trying to improve pricing and selection as well as beefing up customer service.