Supermarket chain Safeway Inc posted quarterly profit that beat Wall Street expectations as it cut costs to help counteract declining food prices, sending its shares up nearly 8 percent on Thursday.

The company also stood by a full-year earnings forecast that is higher than analyst expectations.

U.S. supermarkets are in the middle of a fierce price war and Safeway is battling the perception that its store prices are higher than those of peers such as Kroger Co and Supervalu Inc.

The Pleasanton, California-based operator of Safeway, Vons and Dominick's stores said profit fell to $128.8 million, or 31 cents per share, in the third quarter, ended Sept. 12 from $199.7 million, or 46 cents per share, a year earlier.

Analysts on average expected earnings of 29 cents a share, according to Thomson Reuters I/B/E/S.

Revenue fell 7 percent to $9.46 billion, in line with analysts estimates and also weighed down by lower fuel sales as prices of gasoline fell. Operating and administrative expense declined $13.3 million to $2.396 billion.

Identical-store sales fell 3 percent, excluding fuel. Safeway defines identical stores as those operating in the same period during the current and previous years. The figure does not include replacement stores.

The company said it still expected earnings of $1.70 to $1.90 per share for the year with free cash flow of $1.1 billion to $1.3 billion. Analysts on average had forecast full year earnings of $1.73 per share.

Safeway shares traded up $1.71 at $23.14.

(Reporting by Brad Dorfman; additional reporting by Lisa Baertlein, editing by Dave Zimmerman)