Macy's reported Thursday fiscal second-quarter sales and earnings that topped analysts' expectations, as shoppers responded to the department store's steep discounts. Yet with sales still on the decline, the retailer said it will shutter 100 locations to focus on its best-performing stores.

The company's shares shot more than 16 percent higher in early trading.

"Whenever there's been a setback in our company, we've been first in the industry to take a very aggressive stance at moving us forward," CEO Terry Lundgren told CNBC's "Squawk Box." "That's just part of it. By closing 100 stores… we're getting out in front of this."

Macy's reported earnings, excluding charges, of 54 cents per share, on revenue of $5.87 billion. Analysts had expected earnings of 45 cents a share on $5.75 billion in revenue, according to a consensus estimate from Thomson Reuters.

In the prior-year period, the department store reported earnings per share of 64 cents, on an adjusted basis, on revenue of $6.10 billion.

Macy's reiterated its full-year guidance, which calls for earnings per share of $3.15 to $3.40, and same-store sales to fall between 3 percent and 4 percent. It expects better performance in the fourth quarter, thanks to easier comparisons.

During the fiscal second quarter, Macy's comparable sales fell 2 percent, aided by the closing of 41 underperforming stores. Retail Metrics had been forecasting a 4.4 percent decline in comparable sales.



"A number of factors worked in our favor in the second quarter, including a normalized weather pattern, which contributed to a sales lift in our apparel business in particular," Lundgren said. "We also saw a smaller decrease in tourist spending during prime summer travel months, supported by strengthened promotional events designed to increase customer traffic and conversion."



Sales on international credit cards slipped 12 percent during the quarter, compared with a 20 percent drop in the prior three-month period. Tourism accounts for roughly 5 percent of Macy's annual sales.

Revenue from the struggling apparel category likewise improved during the quarter, a trend the company attributed to better merchandise and more favorable weather. They were just shy of turning positive. Better-than-expected sales during the quarter likewise helped the company clear through excess inventories while preserving more gross margin than management originally expected.

Lundgren said he's confident about consumers' ability to spend moving forward, pointing to growth in auto sales and home improvement.

"This is good news," he told CNBC. "They don't need another car. They don't need to fix their home anymore... So it's my turn. It's our turn."

Most of the 100 stores the company plans to close will be shuttered in early 2017, with the remainder shutting down as leases and other obligations expire or are waived. The locations of these stores will be released at a later date.

Nearly all the stores are cash-flow positive, but "their volume and profitability in most cases have been declining steadily in recent years," said Macy's President Jeff Gennette, who will assume the CEO role from Lundgren in 2017. In some cases, the stores are not performing worse than the overall fleet, but their potential value from redevelopment exceeds their value as a retail store.

Macy's will also close a few stores where there is another location nearby. After these stores close, the retailer will retain a physical footprint in 49 of the top 50 U.S. markets based on population. The company will use the savings from its store closings to focus on its "highest-potential locations," and invest "more aggressively in digital and mobile," Gennette said.

Macy's estimates the annual sales volume it would lose from these 100 stores combined is roughly $1 billion after factoring the revenue it expects to retain due to nearby stores and the web. The reduction in EBITDA is expected to be offset by expense savings beyond those associated with the store closings. The company will outline those savings in the future.

The company will incur charges of $249 million in the second quarter. These charges include a preliminary estimate of upcoming store closings this year and beyond. As further decisions are made, Macy's will update this amount.



Employees impacted by the store closings may be offered positions in nearby stores. Eligible employees who are laid off will be offered severance benefits.



"Although this is partly a reaction to being in a tough competitive position within the landscape, they are being more offensive than most, and this is the right move," Citi analyst Paul Lejuez said. "It is not only good for Macy's but also for the industry."



The retailer will meanwhile continue looking for ways to monetize its store fleet, including exploring opportunities its New York City, downtown Minneapolis and downtown Chicago flagships. It is in negotiations to sell its Union Square men's store in San Francisco for redevelopment. Macy's is also in early talks about potential joint ventures and other strategic alliances with several potential partners.

Macy's operates 728 stores, including 675 of its traditional full-price locations. It has shuttered roughly 90 Macy's stores over the past six years, and opened 13 new locations. It opened six off-price Macy's Backstage stores in 2015 and is also expanding the footprint for its Bluemercury beauty chain.

The company lowered its full-year forecast in May, after reporting its steepest quarterly same-store sales decline since the recession. At that time, the company warned that sluggish sales in warm-weather clothing would weigh on its sales and margins in the second quarter, as it would be forced into additional discounting.

The bar also came down at that time for its full-year comparable sales. Its previous estimates called for a 1 percent drop in same-store sales, and earnings of between $3.80 and $3.90 a share.

The company announced in June that Lundgren would step down from his role in 2017, and be succeeded by Gennette.