Macy's earnings for the quarter ended Aug. 2 also missed the average analyst estimate as the company discounted heavily to win business, squeezing gross margins.

The company said on Wednesday that margins would be flat to slightly down for the rest of the year.

Shares of the company, which also owns the high-end Bloomingdale's chain, fell as much as 6 percent.

"...Many customers still are not feeling comfortable about spending more in an uncertain economic environment," Chief Executive Terry Lundgren said in a statement.

U.S. retail sales unexpectedly stalled in July, data showed on Wednesday, pointing to some loss of momentum in the economy. The sales were the weakest since January.

Shares of Macy's rivals Kohl's Corp and Nordstorm Inc were down 1.8 percent and 1.2 percent respectively.

Macy's said it expects same-store sales to increase 1.5 percent to 2 percent for the full year. It had earlier forecast an increase of 2.5 percent to 3 percent.

The company, which has remodeled many stores, including its flagship Herald Square store in Manhattan, plans more promotions and discounts for the back-to-school season.

Weaker categories in the second quarter included women's and men's sportswear as well as non-athletic shoes, Chief Financial Officer Karen Hoguet said on a conference call.

However, Hoguet said the back-to-school season had been "extremely strong" so far.

"Our juniors business, we really think now has turned around and has been terrific," she said.

The company stuck to its full-year earnings forecast of $4.40 to $4.50 per share.

PROFIT MISS

Analysts remained positive on Macy's long-term prospects despite the disappointing quarter.

"Its focus on improving the merchandise assortment while enhancing the customer experience both in stores and online will likely continue to drive strong results," Stifel Nicolaus analysts wrote in a research note.

At least four brokerages including Stifel reiterated their "buy" or equivalent ratings on the company's stock.

Macy's has spent nearly $2 billion on IT and e-commerce projects over the past five years and has won over customers with services such as in-store pickups for online orders and "ship-from-store".

The ship-from-store service allows customers to order from another Macy's store if the item is not available and have it sent to their home. This helps Macy’s keep a tight hold on inventories, especially at its smaller stores.

Same-store sales, which include sales at macys.com and bloomingdales.com, rose 3.4 percent in the second quarter.

Net income rose to $292 million, or 80 cents per share, from $281 million, or 72 cents per share, a year earlier.

Total sales rose 3.3 percent to $6.27 billion, after declining about 2 percent in each of the previous two quarters.

Analysts on average had expected earnings of 86 cents per share on revenue of $6.3 billion, according to Thomson Reuters I/B/E/S.

Macy's shares were down 4.3 percent at $57.15 in late morning trading.

(Editing by Don Sebastian)

By Devika Krishna Kumar