Oil company BP swung to profit in the second quarter amid higher oil prices and a broader recovery in the global economy this year, after posting a loss in the same period a year earlier. The company earned $3.1 billion in the three months to the end of June, compared with a $16.8bn loss in the same period a year ago. BP is raising its dividend by 4 per cent, after slashing payouts to shareholders last year. It will also begin a $1.4bn share buyback programme. The company's shares gained 2.5 per cent after the earnings announcement on Tuesday. BP clawed back losses this year, after posting a robust $4.6bn profit for the first three months of the year, taking its overall first-half net profit to $7.7bn, compared with a $21.2bn loss in the same period a year earlier. Losses in the first half of last year increased amid a crunch in demand due to the Covid-19 pandemic, forcing the UK-based company to slash its dividend payouts. "Based on the underlying performance of our business, an improving outlook for the environment and confidence in our balance sheet, we are increasing our resilient dividend by 4 per cent per ordinary share and, in addition, we are commencing a buyback of $1.4bn from first-half surplus cash flow," said BP chief Bernard Looney. "On average, at around $60 per barrel, we expect to be able to deliver buybacks of around $1bn per quarter and to have capacity for an annual increase in the dividend per ordinary share of around 4 per cent, through 2025." BP is not the only big oil company to start share repurchases amid a favourable environment for crude commodity prices. Chevron said on Friday that it would <a href="https://www.thenationalnews.com/business/energy/chevron-boss-vows-to-return-more-cash-to-shareholders-1.1124499">begin</a> share buybacks during the current quarter, with repurchases of $2bn to $3bn a year. Other energy companies such as Royal Dutch Shell and Total Energies have also reinstated share buybacks. Oil prices have risen by about 50 per cent since the start of the year, boosting the profitability of big oil companies. BP has embarked on a major overhaul of how it does business following the Covid-19 pandemic. It plans to reach net zero carbon emissions across all its operations on an absolute basis by 2050. Last year, the company wrote off $17.5bn from the value of its oil and gas business as it lowered its oil price expectations through to 2050. In the third quarter, BP will continue with its divestment programme, which last year resulted in the oil company selling its chemicals business to Ineos for $5bn. "We continue to expect divestment and other proceeds for the year to reach $5bn to $6bn during the latter stages of 2021," the company said in a disclosure to the stock market. "As a result of the first half-year divestments, our target of $25bn of divestment and other proceeds between the second half of 2020 and 2025 is now underpinned by agreed or completed transactions of around $14.9bn, with over $10bn of proceeds received."