Warren Buffett firmly believes that one of the keys to success in investing is to hold stocks for the long term. He even went so far as to state in the Berkshire Hathaway (NYSE:BRK-A)(NYSE:BRK-B) 1988 shareholder letter that his "favorite holding period is forever." That's why when Buffett does sell, investors take notice.

One stock Buffett has been selling off this year is oil refiner Phillips 66 (NYSE:PSX). Because of that, investors who hold the stock (myself included) are likely wondering if they should join him and begin unloading their positions.

An oil refinery at twilight reflected in the water.

Image source: Getty Images.

A motivated seller

Berkshire Hathaway started selling off its shares in Phillips 66 this past February when the oil refiner entered into a share repurchase agreement with Buffett's company. Under the terms of that deal, Phillips 66 bought back 35 million of its shares for $93.725 apiece, or $3.3 billion in total. At the time, Buffett stated: "This transaction was solely motivated by our desire to eliminate the regulatory requirements that come with ownership levels above 10%. We remain one of Phillips 66's largest shareholders and plan to continue to hold the stock for the long term."

That transaction was the second time the companies teamed up on a deal where Phillips 66 acquired some of its stock from Berkshire Hathaway. The other came in 2013, when Phillips 66 traded its flow improver business to Berkshire in exchange for $1.35 billion of its shares (which was two-thirds of Berkshire's position at the time). Buffett wanted that business because it was a good fit for its Lubrizol subsidiary, while Phillips 66 took its shares instead of cash since that was a more efficient way of repurchasing its stock.

This time it's different

Other than those transactions, Buffett has been a big buyer of Phillips 66's stock over the years. While his Berkshire Hathaway acquired its initial position in the refiner after U.S. oil giant ConocoPhillips spun off the business in 2012, he has added to that stake in more recent years. One of the more notable purchases came in 2016, when he spent $1.39 billion on another 18 million shares, which boosted his stake up to 15.2% at the time. 

However, Buffett has significantly scaled back his stake this year. February's sale cut Berkshire's position to 45.7 million shares, or about 9.8% of Phillips 66's outstanding stock, which got it under the 10% level for regulatory purposes. The company then followed that up last quarter by jettisoning 12.5 million shares on the open market, which reduced its position to 7.5% of Phillips 66's outstanding stock. Meanwhile, a recent disclosure shows that Buffett's company pared down its holdings to 22.2 million shares, which is just 4.8% of Phillips 66's outstanding stock, though it's still worth $2.5 billion and is one of Berkshire's 15 largest stock investments.

Know when to hold 'em

Buffett built the bulk of his Phillips 66 position in 2015 and 2016 when shares were in the upper $70s. Today, however, the stock is over $110, with most of those gains coming in the last 18 months. Because of that, he'll make a tidy profit on the shares he's selling:

PSX Total Return Price Chart

PSX Total Return Price data by YCharts.

Unlike the direct sale to Phillips 66, Buffett hasn't publicly commented on what's driving these latest sales. Because of that, we're left to speculate that they might be because he wants to build an even bigger cash war chest to capture future opportunities or to lock in some profits since the refining sector can be quite volatile.

What the sales don't appear to be is a shift in Buffett's stated position from earlier this year that he wants to be a long-term investor in the company. Aside from the fact that it's still a large holding, the thesis behind that view -- which is that "Phillips 66 is a great company with a diversified downstream portfolio and a strong management team," according to Buffett -- hasn't changed.

The only things that have changed since he made those remarks are positives. For starters, the stock is up 20% since Buffett sold back shares to Phillips 66. That's due in large part because the company reported strong earnings in the first and second quarters, continued returning cash to investors -- including increasing its dividend another 14% as well as buying back more shares -- and secured two needle-moving expansion projects that will fuel growth in the coming years.

Focus on why he's still holding, not why he's selling

While Buffett has significantly trimmed his stake in Phillips 66 this year, he still plans to be a long-term investor in the company, albeit on a smaller scale. That's because he believes it to be a great company with a strong management team. Since that view still holds true, investors shouldn't feel as if they should follow Buffett by selling unless they need the cash for something else. 

Matthew DiLallo owns shares of Berkshire Hathaway (B shares), ConocoPhillips, and Phillips 66. The Motley Fool recommends Berkshire Hathaway (B shares). The Motley Fool has a disclosure policy.