Whole Foods is set to gobble up a piece of Stonestown Galleria, replacing a portion of the shuttered Macy’s at the west side San Francisco shopping center.

The upscale grocer will occupy part of the ground floor of the old Macy’s, which closed in March as part of the retailer’s multiyear plan to shutter department stores around the country, according to mall owner General Growth Properties.

The Whole Foods will open late next year.

“The addition of Whole Foods will further establish the shopping center into an all-encompassing hub for convenience, dining, retail and entertainment,” company spokeswoman Lindsay Kahn said in a statement.

Last July, General Growth filed an application seeking city approval to reconfigure the existing 286,000-square-foot Macy’s building into a mixed-use venue with up to 12 movie screens, a grocery store and a collection of eating and drinking spots.

Darren Iverson, senior general manager for the property owner, declined to say how big the new Whole Foods would be. He also said it’s too early to announce any other leases for the old Macy’s building.

“People are going to be excited to see what is in store — it’s really going to evolve Stonestown to the next level,” Iverson said.

Like other retailers, Macy’s has been aggressively cutting costs as shoppers abandon brick-and-mortar department stores, instead buying their clothes, home goods and cosmetics online. The retailer closed 40 stores in 2016 and has a multiyear plan to close 100 more.

It has also been selling off its real estate. In January 2017, Macy’s sold the Stonestown building to General Growth, which owns and operates the rest of the Stonestown complex, for $41 million. That sale came two months after it sold its Union Square men’s store to Morgan Stanley for $250 million.

In February, Macy’s said it is exploring opportunities to sell the former I. Magnin building, which contains approximately 240,000 square feet of retail space and houses part of its flagship store in Union Square.

Last year, an estimated 3,900 Macy’s employees lost their jobs because of store closures.

In contrast, Whole Foods has been in expansion mode. In February, it announced plans to open a 55,000-square-feet store at Trinity Place in the Mid-Market neighborhood. On April 26, the Planning Commission is scheduled to vote on whether Whole Foods will be granted permission to open one of its smaller Whole Foods 365 stores in the old Lombardi Sports store at Polk and Jackson streets.

Target recently opened a 32,000-square-foot store in the former Sports Authority space at Stonestown, one of its 30 “small format” stores. Other stores in the mall include Apple, Nordstom and Trader Joe’s.

Supervisor Norman Yee, who represents the area, said having a Whole Foods at Stonestown will be “better than having a big, old empty building.”

“I think there is a population that can support a supermarket there,” said Yee. “That area, especially Parkmerced, will benefit from having a grocery store within walking distance.”