BP plc, the first supermajor out of the gate to deliver first quarter results, posted a surprising net profit that upended Wall Street forecasts as lower costs more than offset the impact of weaker commodity prices.

Replacement cost profit, an accounting method used by European-based companies that is similar to U.S. net income, totaled $532 million (17 cents/share), which was sharply lower than year-ago profits of $2.57 billion (85 cents). For context, 1Q2016 oil prices averaged $34/bbl, compared with an average of $55 in 1Q2015. BP’s underlying cost replacement in 4Q2015 was $196 million (6 cents/share), when oil prices averaged $10 higher at $44/bbl.

Wall Street had forecast BP on average would lose $140 million.

“Despite the challenging environment, we are driving toward our near-term goal of rebalancing BP’s cash flows,” Group CEO Bob Dudley said. “Operational performance is strong, and our work to reset costs has considerable momentum and is delivering results. Furthermore, development of our next wave of material upstream projects is well on track.”

Market fundamentals “continue to suggest that the combination of robust demand and weak supply growth will move global oil markets closer into balance by the end of the year.”

Unlike some operators that have reduced their shareholder payouts, BP kept its dividend unchanged at 10 cents/share to be paid in June. Underlying operating cash flow was $3.0 billion, which excluded $1.1 billion of payments related to the 2010 Macondo oil spill. The spill payments were offset by matching asset sales of $1.1 billion.

Organic capital expenditure (capex) was $3.9 billion, versus year-ago spend of $4.4 billion. Total organic capex this year is pegged at around $17 billion. But BP is going to be flexible because of current commodity prices. If low oil prices were to continue, capex is expected to average $15-17 billion in 2017. That compares with about $24 billion in 2013 spending, when oil prices were averaging $90-100/bbl.

What’s keeping BP afloat in part are falling costs across the organization, CFO Brian Gilvary said. Cash costs in the last four quarters alone have fallen by $4.6 billion from full-year 2014. Cash costs for 2017 now are estimated to be $7 billion lower than in 2014.

“As we steadily take out more costs, the point at which we expect to be able to rebalance 2017 organic sources and uses of cash continues to move lower,” Gilvary said. “We currently anticipate being able to achieve this at oil prices in the range $50-55/bbl. This progress underpins our commitment to sustaining BP’s dividend as the first priority within our financial frame.” But, “should prices remain low, we have the flexibility to adjust further within the financial framework.”

There comes a point, Gilvary said, when cutting costs and delaying projects can’t match BP’s itch to build production. Like many in the industry, he said exploration and development have to be funded. A “large part” of the cuts made across the organization are “sustainable,” but “inevitably, there are tradeoffs,” he said.

One final investment decision is planned in the United States this year for another expansion of the Mad Dog facility in the deepwater Gulf of Mexico (see Daily GPI, Jan. 7). BP expects projects scheduled to start up through 2017 will put in place 500,000 boe/d net of new capacity.

The upstream segment reported an underlying pre-tax replacement cost loss of $747 million, nearly flat sequentially. Lower costs, including the benefits of simplified programs and lower exploration writeoffs, mostly offset the impact of lower prices.

Overall production, including a stake in Russia’s OAO Rosneft, totaled 3.5 million boe/d. Excluding Rosneft, upstream production was 2.4 million boe/d, 5.2% higher year/year.

Without taking out the underlying replacement costs, BP lost $583 million (minus $2.63/share) in 1Q2016, versus profits a year ago of $2.6 billion ($11.54) and a loss of $3.307 billion (minus $12.16) in 4Q2015. One-time writedowns totaled $583 million. Operating net cash provided was $1.9 billion, flat year/year. Excluding Macondo spill payments, net cash was $3.0 billion, compared with $2.5 billion in 1Q2015.

A pre-tax charge of $917 million was recorded for the Macondo spill in 1Q2016, bringing cumulative charges for the tragedy to $56.368 billion. A $20.8 billion settlement with U.S. officials was given final approval earlier this month, which resolved most of the legal claims (see Daily GPI, April 4). BP still faces some civil litigation and ongoing costs, including an annual liability for the next 20 years or so of around $1 billion that was imposed by the settlement.