Warren Buffett’s Berkshire Hathaway Inc. exited a $3.7 billion investment in Exxon Mobil Corp. amid a slump in oil prices.

Crude has fallen by about half since June as U.S. production surged and the Organization of Petroleum Exporting Countries resisted output cuts. The decline has ravaged oil company profits and forced major producers and drillers to slash spending and fire thousands of workers.

Berkshire has “not really had the hot hand in energy,” Fadel Gheit, an analyst for Oppenheimer & Co. in New York, said in a phone interview. “The whole energy sector obviously is now traded in completely different circumstances than they were only a year ago.”

Buffett built Berkshire into the fourth-biggest company in the world through acquisitions and by picking stocks that surged in value like Coca-Cola Co. and the former Washington Post Co. Still, he’s had a mixed record when it comes to investing in energy companies.

One of his biggest winners was PetroChina Co. In 2007, he booked a $3.5 billion profit after selling an investment in the oil producer of about $500 million. That was followed by an ill- timed bet on ConocoPhillips stock before crude prices peaked in 2008, and a $2 billion bond investment in Energy Future Holdings Corp. that was later written down as natural gas prices plunged.

Berkshire’s 41.1 million shares of Exxon cost on average $90.86 apiece in 2013, according to the latest annual report. A regulatory filing Tuesday showed Buffett sold the holding during the fourth quarter. The oil company traded for an average of $93.27 in those three months, so Berkshire could have sold the stake at a profit. Scott Silvestri, a spokesman for Exxon, declined to comment.

Energy Holdings

Buffett also eliminated a smaller holding in ConocoPhillips while adding to a bet on Canadian synthetic crude oil producer Suncor Energy Inc. and oil refiner Phillips 66, according to the filing, which detailed the U.S. stock portfolio at Buffett’s company as of Dec. 31.

The changes show that that there are differing views about energy stocks at Berkshire, said Jeff Matthews, a shareholder and author of books about the company. Buffett, 84, has been handing more funds to his back-up stock pickers, Todd Combs and Ted Weschler, as part of his succession plan. The billionaire Berkshire chairman and chief executive officer has said the biggest holdings in the portfolio tend to be his.

“There was clearly no edict that says, ‘Oil is terrible, let’s get out,’” Matthews said in a phone interview. “Someone has a different opinion about it.”

IBM Investment

Buffett affirmed his support for one of his biggest holdings, International Business Machines Corp., in the fourth quarter, by adding 6.5 million shares. The stake is now worth about $12.4 billion. Buffett didn’t respond to a request for comment sent to an assistant.

Last year, the computer-services company fell below the price Buffett paid for most of the stake after abandoning an earnings forecast. CEO Ginni Rometty is trying to reignite growth at IBM by expanding sales for newer cloud computing and data analytics offerings.

Berkshire also increased its investment in agricultural equipment maker Deere & Co. and disclosed a stake in Rupert Murdoch’s 21st Century Fox Inc. valued at more than $160 million based on Tuesday’s closing price.