Now free of its ailing Eckerd drugstore chain, J.C. Penney ( JCP) Tuesday swung to a second-quarter profit, matching analysts' forecasts. It also cited strong back-to-school department store sales and improved gross margins.

The mainly mall-based department store chain was upbeat about the current quarter, guiding earnings within range of the Wall Street consensus.

Net income was $1 million, which because of preferred dividends translated into a loss of 2 cents a share in the second quarter. The company had break-even results, or a loss of 2 cents a share, a year ago. Results in both quarters included losses associated with the Eckerd division.

Penney said earnings from continuing operations were 23 cents a share in the three months ended July 31, compared to a loss of 3 cents a share in the year-earlier period. Total sales were up 5.8% at $3.86 billion, with same-store department store sales up 7.1%. Same-store Internet and catalog sales dropped 1.6%, however.

"Early back-to-school results are exceeding our expectations," said J.C. Penney Chief Executive Allen Questrom in a statement.

During the quarter, Plano, Texas-based Penney completed the $4.5 billion sale of its Eckerd drugstore chain to both CVS ( CVS) and Jean Coutu Group, operator of the Brooks Pharmacy chain in the Northeast. The operating loss in the just-completed quarter related to the Eckerd sale was $71 million, net of taxes, the company said.

Tuesday's results come as no shock, as the company upped its second-quarter earnings expectation to 22 cents a share on Aug. 2, well ahead of analysts' consensus estimate at the time. It also announced a $3 billion stock buyback program to be completed over the next year and a plan to retire $2.3 billion in debt. The moves are expected to improve the company's balance sheet by $8 billion.

The company said Tuesday that operating profit in the second quarter jumped to $156 million, from $53 million in the year-ago quarter.

Meanwhile, gross margin expanded 150 basis points, thanks to less clearance merchandise for sale and improved sell-through of seasonal items. Expenses decreased 110 basis points.

Looking ahead, August department store sales have come in above expectations thus far, Penney said, and operating profit in the third quarter should continue to be boosted by improved gross margins and expense management.

"A number of external factors, including higher oil prices and concerns over terrorism, could impact future consumer spending patterns, but we remain confident that our third quarter sales and operating profits will improve," Questrom said.

The company expects to have a profit of 35 cents to 40 cents a share in the quarter, within range of analysts' average estimate of 37 cents a share. Penney noted that the expected results have been reduced by 11 cents a share due to one-time charges associated with the planned retirement of debt.

Penney earned 25 cents a share in the year-ago third quarter.

Shares of Penney were moving up 26 cents, or 0.7%, at $39.01 in Tuesday premarket trading.

If you liked this article you might like

Hot Topic's Relief Bounce

Hot Topic's Relief Bounce

Limited Brands Profit Jumps

Limited Brands Profit Jumps

Glitch Lingers at Ross Stores

Glitch Lingers at Ross Stores

Dillard's Halves Loss

Dillard's Halves Loss

Do-It-Yourself Boost for Economy

Do-It-Yourself Boost for Economy