Grocer Great Atlantic & Pacific Tea ( GAP), also known as A&P, swung to a third-quarter profit as an income tax benefit helped offset declining sales.

For the quarter ended Dec. 2, A&P earned $40.7 million, or 97 cents a share, compared with a year-ago loss of $71 million, or $1.74 a share.

The earnings included a tax benefit of $45 million, or $1.07 a share, related to the recognition of foreign tax credits. The results for both years also included several charges and one-time benefits.

Adjusted for items, A&P's U.S. business had a third-quarter loss from operations of $16 million, narrowed from $21 million a year earlier.

Sales slipped to $1.54 billion from $1.58 billion, while same-store sales dropped 3%.

A&P, whose chains include Food Emporium and Super Fresh, attributed the same-store sales drop to a post-Hurricane Katrina lift in the year-earlier period and difficult economic conditions in the Midwest. Same-store sales in the company's core business in the Northeast were flat.

"While our sales performance was impacted by difficult comparisons to prior year results, we made solid progress in our core Northeast market," said Chairman Christian Haub in a statement. "We made significant investments during the quarter in accordance with our strategy and these actions will contribute to sales and earnings growth in future periods."

More from Stocks

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Neel Kashkari: The Heart of Our Financial System Is More Radioactive Than Ever

Neel Kashkari: The Heart of Our Financial System Is More Radioactive Than Ever

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Flashback Friday: Amazon, Chip Stocks, Memorial Day

Flashback Friday: Amazon, Chip Stocks, Memorial Day

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain