(Adds details, background)
Feb 22 (Reuters) - U.S. refiner HollyFrontier Corp reported a smaller-than-expected loss as cost cuts partially offset a decline in refining margins.
U.S. refiners amassed large inventories that punished margins last year, but now the industry faces the prospects of higher crude prices and falling demand for gasoline.
Total operating costs and expenses in the fourth quarter fell nearly 5 percent to $2.84 billion.
HollyFrontier's refining margins fell 27 percent to $7.23 per barrel. The company refined 279,760 barrels per day (bpd) in the quarter, compared with 240,010 bpd a year earlier.
Net income attributable to the company's shareholders was $53.2 million, or 30 cents per share, in the quarter ended Dec. 31, compared with a loss of $43.9 million, or 24 cents per share, a year earlier.
Excluding items, the company posted a loss of 6 cents per share, smaller than the average analyst estimate of a loss of 7 cents, according to Thomson Reuters I/B/E/S.
The company's sales and other revenue rose marginally to $2.96 billion. (Reporting by John Benny in Bengaluru; Editing by Maju Samuel)