The company, whose shares rose more than 2 percent, said its exclusive merchandise had helped it win market share. In addition, Bloomingdale's benefited from a pickup in luxury spending.
Chief Executive Officer Terry Lundgren attributed the results to better margins, disciplined inventory management and Macy's program to allow stores greater leeway in catering to local tastes. These factors also prepared the company to woo shoppers despite the threat of a new dip in consumer spending.
While the economic environment remains uncertain, Macy's and Bloomingdale's have a terrific opportunity to continue to take market share, Lundgren said in a statement.
Macy's sales at stores open at least a year increased 4.9 percent, surpassing Wall Street expectations in each of the three months of the quarter.
Last week, Macy's reported a 7.3 percent rise in July same-store sales, outperforming rivals such as J.C. Penney Co Inc
Tighter inventories continued to help Macy's gross margins, which rose 0.4 percentage points to 41.9 percent, and reduced the need for discounting.
Macy's has redoubled its efforts to sell exclusive products, which make up more than 40 percent of overall sales and offer better margins. Last week, for example, the company launched its Material Girl collection, designed in part by pop star Madonna.
Cincinnati-based Macy's reported net income of $147 million, or 35 cents per share, for the second quarter ended July 31, compared with $7 million, or 2 cents per share, a year earlier.
Analysts on average were expecting a profit of 29 cents per share, according to Thomson Reuters I/B/E/S.
Overall sales rose 7.2 percent to $5.54 billion during the quarter, exceeding Wall Street forecasts of $5.50 billion.
Citing better-than-expected sales trends, Macy's raised its forecast for full-year same-store sales growth to a range of 4.0 percent to 4.2 percent. It previously had expected 3.0 percent to 3.5 percent.
The company also raised its full-year profit outlook by 10 cents a share to a range of $1.85 to $1.90, compared with Wall Street's average forecast of $1.87.
Macy's shares were up 2.2 percent at $19.81 in early New York Stock Exchange trading.
(Reporting by Phil Wahba; Editing by Derek Caney and Lisa Von Ahn)