NEW YORK -- Macy's reported stronger-than-expected sales and profits for the fourth quarter less than a month after it announced a major restructuring.

Shares rose 3% before the opening bell Tuesday but gave up those gains along with the broader markets.

The quarterly report comes three weeks after the department store chain said it was closing 125 of its least productive stores and cutting 2,000 corporate jobs. It also says it is testing new smaller-store formats. The store closures represent one fifth of Macy's total. They include about 30 that are in the process of closing and account for $1.4 billion in annual sales.

Macy's, like its peers Nordstrom, Kohl's and J.C. Penney, is dealing with stiffer competition and shoppers' changing behavior. Department stores are seeing their customers increasingly favor off-price stores like T.J. Maxx for big discounts on name brands. They're also renting and buying second-hand goods online. J.C. Penney is slated to report its fourth-quarter results Thursday, while Kohl's and Penney are expected to report final quarterly figures next week.

The trade war with China has raised costs for most, and now, a new virus in China is also keeping tourists away from U.S. stores. Moreover, it's throwing a wrench in its manufacturing facilities and supply chains. Macy's says it is viewing 2020 as a transition year and reiterated its annual profit guidance, but says it's too early to include the impact from the virus. However, Macy's CEO Jeff Gennette told analysts during the conference call Tuesday it's seeing a slowdown in sales at its 70 U.S. Macy's stores that have a big Asian business including one in Flushing, Queens and the other in San Francisco's Union Square. At this point it's not concerning, Gennette said.

Macy's also expects a slowdown in products coming from Asia and is working with both its suppliers to figure out contingency plans for certain items.

“As a fashion retailer, there is a shelf life'' for products, Gennette said.

Overall, Macy's has embraced several strategies as a way to pull customers back in the stores. That includes teaming up with resale site ThredUp. The company's Bloomingdale's division launched a rental service last year. And it's been expanding its off-price concept called Backstage in many of its stores. It also has been upgrading the look of its top 150 stores in healthy malls. Those account for about half of its total brick and mortar store sales. Earlier in February, it said that it plans to upgrade an additional 100 stores this year.

Gennette said there was a significant improvement in the fourth quarter, including a "meaningful'' sales uptick in the 10 shopping days before Christmas. Still, the company's net income fell to $340 million, or $1.09 per share, in the quarter ended Feb. 1. That compares with $740 million, or $2.37 per share, in the year-ago period. Adjusted earnings per share was $2.12. Net sales were $8.34 billion, down slightly from $8.45 billion a year earlier.

Analysts were expecting earnings per share of $1.96 and net sales of $8.32 billion, according to FactSet.

Same-store sales, a key measure for a retailer's health, slipped 0.5%, including licensed businesses like jewelry. That was still an improvement from the 3.5% drop seen in the previous quarter.

Shares slipped 70 cents to $14.75 in midday trading.