Walgreen Co posted a better-than-expected quarterly profit on Monday as the drugstore chain controlled costs even as consumers cut back on discretionary buying.

Walgreen has cut about 1,000 jobs at its headquarters and other non-store locations and has more effectively managed its employees' hours to rein in salary costs. It has also reduced the number of 24-hour pharmacies and taken other steps as it tries to save $1 billion per year by fiscal 2011.

They did a really nice job controlling growth in (selling, general and administrative) costs, Morningstar Senior Analyst Mitch Corwin said.

He noted that the slowing growth in costs comes as Walgreen is in transition as it restructures in the face of a recessionary economy.

They are going to emerge from this downturn a better firm with improved margins and market share and a strong balance sheet, Corwin said. Morningstar gives Walgreen its top five-star rating and has a fair-value estimate of $38 a share.

Walgreen's shares jumped more than 10 percent in morning trading.

Walgreen also said it filled 4 percent more prescriptions in the quarter than a year ago, while retail competitors filled 1 percent fewer prescriptions.

Walgreen earned $640 million, or 65 cents per share, in the fiscal second quarter that ended February 28, compared with a profit of $686 million, or 69 cents per share, a year earlier.

The company is a few months into a major overhaul that includes job cuts, store remodeling and moving some pharmacy work to centralized locations to cut costs.

Excluding items related to that restructuring, Walgreen earned 69 cents per share, compared with the average analyst estimate of 66 cents per share, according to Reuters Estimates.

Sales rose 7 percent to $16.5 billion, while sales at stores open at least a year rose 1.3 percent. Sales and earnings were both hurt because 2009 had one less day than 2008, which was a leap year.

Walgreen also spent more on promotions to encourage customers to buy nonprescription items.

In the past, drugstores could typically charge more than chains such as Wal-Mart Stores Inc because customers were looking more for convenience, not value. Now Walgreen and its rivals are selling their own lower-priced brands and putting more items on sale to keep shoppers coming back during the recession.

Walgreen is promoting paper towels, tissues, food and other items in new advertising, touting itself as a place to shop for Affordable Essentials.

The company took 6 cents per share in charges for its Rewiring for Growth restructuring program during the quarter, and saw 2 cents per share in cost savings.

Walgreen, which had 6,679 drugstores at the end of February, scaled back its store opening plans in July and again in December. It has been opening some stores and last week said it would buy some assets of Drug Fair, a small chain based in New Jersey that filed for bankruptcy protection. Walgreen was also buying 12 stores in California and Idaho from Rite Aid Corp .

Walgreen shares rose $2.51, or 10.33 percent, to $26.80 on the New York Stock Exchange. The stock is up 7.3 percent this year, while rival CVS Caremark Corp is down 4 percent.

(Additional reporting by Jessica Wohl; Editing by Maureen Bavdek)