(Sharecast News) - BP swung into the red on a reported basis in the second quarter as a result of $2.77bn of so-called "adjusting items", but that didn't stop the energy giant from beating market forecasts on an underlying basis and unveiling another $1.75bn share buyback programme.

The company booked a replacement cost loss - which reflects the replacement cost of inventories sold, adjusted for inventory holding gains and losses - of $16m for the three months to 30 June, compared with a profit of $2.34bn a year earlier.

Nevertheless, underlying RC profit - BP's preferred measure of profitability - improved by 6% to $2.76bn, well ahead of the consensus forecast of $2.54bn.

Operating cash flow swelled to $8.1bn, up from $6.29bn the year before, while capital expenditure shrunk to $3.69bn from $4.31bn. Strong cash flow helped the company to reduce net debt to $22.6bn, down from $24.0bn at the end of the first quarter.

"We are driving focus across the business and reducing costs, all while building momentum in our drive to 2025," said chief executive Murray Auchincloss.

"Our recent go-ahead of the Kaskida development in the Gulf of Mexico business, and decision to take full ownership of bp Bunge Bioenergia while scaling back plans for new biofuels projects, demonstrate our commitment to delivering as a simpler, more focused and higher value company. This all supports growing returns for shareholders, as we have announced today."

Following a $1.75bn share buyback for the first quarter, which was completed on 27 July, BP said it would do the same again for the second quarter, and committed to another $3.5bn for the second half as part of its plans to return at least 80% of surplus cash flow to shareholders. The company intends to buy back $14bn of shares through to 2025.

In addition, BP announced a dividend for the second quarter of 8.0 cents, up from the 7.27 cents paid out in the first quarter.