ConocoPhillips (NYSE:COP) cashed in on higher oil prices during the second quarter. The oil company generated $1.7 billion of adjusted earnings, or $1.27 per share, its highest tally since 2018. That was quite a turnaround for the company, which posted a $1 billion adjusted loss in the year-ago period. That strong result enabled the company to boost its share repurchase program, through which it aims to return more money to its investors.

Drilling down into ConocoPhillips' second-quarter results

ConocoPhillips produced an average of 1.547 million barrels of oil equivalent (BOE) per day during the second quarter, up 566,000 BOE per day from the year-ago period. Contributing to that surging output was its acquisition of Concho Resources, as well as the resumption of production from wells it shut in during the pandemic. After adjusting for those factors, output was up 3% year over year, driven by new production in the Lower 48 states and its development programs around the world.

The silhouette of a person next to an oil well.

Image source: Getty Images.

ConocoPhillips' surging output couldn't have come at a better time. The oil giant took advantage of the strong upswing in oil prices, realizing $50.03 per BOE in the period, up 117% from last year's second quarter.

That combination of higher crude prices and increased production led to a gusher of cash flow in Q2: Cash flow from operations totaled $4 billion. The company used that money to fund its $1.3 billion capital program while returning $1.2 billion to shareholders, split evenly between its dividend payout and share repurchases. It also enhanced its already-mammoth cash position, which ended the quarter at more than $9 billion.

A look at what's ahead for ConocoPhillips

ConocoPhillips expects its production to moderate during the third quarter. The oil giant anticipates that its output will come in between 1.48 million and 1.52 million BOE per day as it completes maintenance projects on assets in Alaska and the Asia Pacific region.

Meanwhile, the company plans to distribute nearly $6 billion to shareholders this year -- $2.3 billion via dividend payments and around $3.5 billion through share repurchases. That buyback total includes its initially planned $1.5 billion program, an additional $1 billion in repurchases thanks to higher oil prices, and another $1 billion in potential buybacks funded by the sale of its stake in Cenovus Energy (NYSE:CVE).

ConocoPhillips also expects to sell other non-core assets in the coming quarters. The oil company agreed to sell some of its non-core assets in the Lower 48 last month for nearly $200 million. It plans to generate $2 billion to $3 billion over the next 18 months through asset sales.

Longer term, ConocoPhillips sees itself becoming even more of a cash flow generating machine. Management recently detailed a 10-year plan to invest $7 billion per year to grow its production at a 3% compound annual rate. Assuming oil averages $50 a barrel, that plan would enable it to produce a cumulative $70 billion in free cash flow over the next 10 years. The company intends to use about $5 billion of that money to repay debt over the next five years while returning the remaining amount to shareholders via its dividend and its stock repurchase program. The company believes its modest growth strategy coupled with significant cash returns to shareholders is the right way to create value for shareholders during the energy transition.

Focused on producing cash

ConocoPhillips took advantage of last year's oil market turmoil to acquire Concho Resources, a purchase that paid off big time during the second quarter. The oil giant produced a gusher of cash, enabling it to return more to shareholders via its repurchase program. It expects to continue generating and returning free cash flow in the coming years, making it a lower-risk oil stock.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.