Aug 3 (Reuters) - Diamondback Energy Inc on Monday posted a quarterly loss from a year-ago profit, as the Permian basin producer took a $2.54 billion impairment charge against its oil and gas properties after crude prices plummeted.

The company's shares fell 2.5% in extended trade.

Crude prices collapsed to historic lows earlier this year as coronavirus lockdowns drained demand for oil and a battle for market share among the world's top producers led to excess supply.

Diamondback said average realized hedged prices fell about 35% to $35.21 per barrel of oil.

The Midland, Texas-based company's quarterly average production stood at 294,126 barrels of oil equivalent per day (boepd), compared with 280,365 boepd last year.

With oil prices having rebounded from a dip into negative prices in April, producers have started restoring some of their shut-in drilling.

The company said it has brought back 5% of the oil production which was curtailed during the second quarter, as it is now receiving significantly higher realized prices.

Diamondback said net attributable loss to the company was $2.39 billion, or $15.17 per share, for the second quarter ended June 30, from a profit of $349 million, or $2.11 per share, last year.

Excluding items, it posted a profit of 15 cents per share, above average analysts' estimate of 2 cents per share, according to Refinitiv IBES. (Reporting by Arunima Kumar in Bengaluru; Editing by Devika Syamnath)