Updated

Department store operator J.C. Penney Co. Inc. (JCP) on Tuesday posted a quarterly operating profit, reversing a year-earlier loss, on inventory controls and strong sales of jeans, home furnishings and career clothes.

The company, which recently sold its money-losing Eckerd drugstore business, said early back-to-school sales have been better than expected but cautioned that energy prices and terrorism worries could sap consumer spending.

Plano, Texas-based Penney, whose shares rose in morning trading, reported operating earnings of $72 million, or 23 cents per share, for the second quarter, compared with a loss of $3 million, or 3 cents a share, a year earlier.

The earnings were at the top of the range forecast by the company and were in line with the average estimate among analysts polled by Reuters Estimates.

Net income, including Eckerd results, was $1 million. Including a preferred stock dividend, it posted a net loss of 2 cents per share.

The company reported a loss from discontinued operations, after taxes, of $71 million, reflecting Eckerd's operating losses as well as adjustments to the final terms of the sale of the business.

Penney is in the middle of a five-year turnaround plan that has earned high marks from analysts. Selling the Eckerd chain to pharmacy industry rivals CVS Corp. (CVS) and Jean Coutu Group freed up the company to focus entirely on its department stores and related Internet and catalog operations.

The company is working to offer more fashionable clothing to appeal to younger consumers and is pushing its Chris Madden home decorating line.

It said its inventory scrutiny has paid off, keeping stock more in balance with demand. It has a 98 percent in-stock level in advertised items and basics.

"Early back-to-school results are exceeding our expectations," Chief Executive Allen Questrom said in a statement. "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."

Vanessa Castagna, chief executive of J.C. Penney stores, said on the conference call that vintage denim was "doing very, very well," and the company's children's department and "dorm shop" were also strong.

Department store sales beat expectations in the first two weeks of August, Penney said, and operating profit for the quarter is expected to benefit from gross margin improvement.

The company forecast third-quarter earnings from continuing operations of 35 cents to 40 cents per share. It said the guidance has been reduced to reflect the 11-cents-per-share impact of previously announced early debt retirement.

Retail sales for the second quarter rose 5.8 percent to $3.59 billion, while sales at department stores open at least a year, or same-store sales, rose 7.1 percent. Catalog and Internet sales fell 1.6 percent.

Gross margins rose 150 basis points, helped by sales of summer items and less clearance merchandise.

Penney shares were ahead 18 cents at $38.93 near midday on the New York Stock Exchange (search) after being up as much as $1.05, or 2.7 percent, earlier in the session.