Macy's Inc. reported a strong third-quarter net income of $139 million ($0.32 per share), but a fall in gross margin caused shares to slip in early trading on Wednesday.

Macy's net income surged dramatically compared to its third-quarter performance last year, partly due to a strong and developing online presence and targeting of its merchandise to local markets. The $139 million income marked a jump from $10 million ($0.02 per share) for the same three-month period last year.

Net sales also grew 4.1 percent from year to year, from $5.62 billion to $5.85 billion. Identical-store sales rose a similar 4 percent.

You can feel the momentum and confidence that has been building at Macy's since our organizational changes in 2009, and especially over the past nine months, Terry Lundgren, chairman and CEO of Macy's, said in a statement released by the company.

We believe this will help us to continue to capture market share in the fourth quarter and lay the foundation for continued innovation in our business in 2012.

With that, the company also raised its full-year outlook. Originally expected to be somewhere between $2.60 and $2.65 per share, Macy's upped earnings-per-share expectations to between $2.70 and $2.75 per year.

Still, shares of Macy's fell in early trading - a 3.4 percent drop as of 11:45 a.m. ET. This was because its gross margin - the percentage of revenue available after taking out the cost of goods sold - shrunk to 39.4 percent from 40 percent the same period a year ago, off free shipping offers and higher commodity costs on cotton.

Macy's, the second-largest department store chain in the United States, is the first of the major retailers to release third-quarter earnings ahead of the holiday shopping season, which accounts for the bulk of annual revenue.

Our team is very excited about plans for the upcoming holiday selling season, Lundgren said in the statement. A customer-centric approach to the business at Macy's and Bloomingdale's has led to an outstanding assortment of distinctive fashion product.

There's good reason to be excited. Lundgren made special mention of Bloomingdale's, which he said enjoyed a strong quarter, signifying that wealthier customers keep spending despite the continued sluggish economy.

And Macy's overall continues to thrive despite the sluggish economy, and especially compared to rival department store chains. J.C. Penney Co.'s third-quarter report is due Monday, but expectations are that its revenue will fall as much as 2.8 percent, according to Forbes.

Lundgren thinks the company will continue to build momentum into the most important quarter.

Our stores look great, Lundgren said. Our online sites, as well as our mobile-enhanced websites and apps, provide a robust and convenient complement to the active lifestyles of shoppers. The quality and creativity of our marketing support for holiday is the strongest ever.