BP Plc's (NYSE: BP) profit nearly tripled in the first quarter of 2017 from a year earlier, buoyed by rising oil prices and production that hit a five-year high, while debt piled up in order to pay for acquisitions and costs for the 2010 Gulf of Mexico spill.

The British oil and gas company joined oil major rivals including ExxonMobil (NYSE: XOM), Chevron Corp. (NYSE: CVX) and Total SA (NYSE: TOT) in posting stronger-than-expected quarterly earnings, mostly thanks to higher oil and gas prices.

Oil prices rose by 50% in the past year to around $54 a barrel (bbl) in the first quarter.

BP expects prices to average between $50/bbl and $55/bbl in 2017, heading to the higher end of the range if OPEC and major producing countries extend production cuts into the second half of the year, CFO Brian Gilvary told Reuters.

The results could assuage some concerns among investors, who were jolted when BP in February raised the oil price at which it could balance its books this year to $60/bbl after a string of investments that pushed up borrowing.

Three years since the oil prices slumped from above $100/bbl and after BP slashed costs with layoffs and project delays, investors want to see cash generation to cover spending and dividend payouts, while reducing ballooning debt.

BP's shares were trading 2.4% higher at 2:21 p.m. CT (7:21 GMT), the biggest winner on London's bluechip FTSE 100 index.

"The results are positive," Cenkos Securities analysts wrote, but adding that "gearing is creeping up towards the max of the 20%-30% target range, although divestments, including the recent $1.7 billion SECCO sale in China, should help."

Net debt rose 9% in the quarter to $38.6 billion, lifting BP's gearing of net debt to shareholders' equity from 26% to 28%, closer to its ceiling of 30%.

"The debt was always going to rise in the first half of the year and the 28% gearing, frankly, that doesn't cause any problems at all," Gilvary said.

To keep oil prices buoyant, oil companies want OPEC, Russia and other producers to extend their global pact to reduce production for another six months from June 30.

"If they don't get rolled into the second half of the year we will continue to see more [price] volatility," Gilvary said.

London-based BP is set to start up seven projects this year, including in Oman and Azerbaijan, the largest number in a single year in BP's history. It hopes to add 800,000 bbl/d of new production by the end of the decade.

The renewal of BP's ADCO onshore oil concession in Abu Dhabi in December was a main contributor to BP's first quarter rise in output. Total upstream production, excluding BP's share of Rosneft output, reached a five-year high of 2.39 million bbl/d.

Projects under construction are ahead of schedule and on average 15% below budget, BP said.

BP's operating cash flow in the quarter rose to $2.1 billion from $1.9 billion a year earlier, hit by payments made towards settling fines related to the 2010 deadly Deepwater Horizon rig explosion and oil spill in the Gulf of Mexico.

BP took a pre-tax $161 million charge in the first quarter related to the spill. Total payments are expected to reach $4.5 billion to $5.5 billion this year.

BP reported first-quarter underlying replacement cost profit, the company's definition of net income, of $1.51 billion, exceeding analysts' average forecast of $1.26 billion.