Warren Buffett's conglomerate Berkshire Hathaway cut its stake in oil exploration and production (E&P), refining and marketing company Suncor Energy by 7.7 million shares to 22.3 million shares over the quarter, filings with the Securities and Exchange Commission filing showed. The company's stock price was little changed at the end of the quarter.

Buffett's firm maintained its stake in pipeline company Kinder Morgan of 26.5 million shares, however, amid a nearly 5 percent gain in the company's stock price.

Berkshire also increased its stake in U.S. refining company Phillips 66 by 3.2 million shares to 78.8 million shares, despite a loss of 8.4 percent in the company's share price.

U.S. crude prices rose 26 percent over the quarter to $48.33 a barrel after topping $51 a barrel. Prices rallied after major producers, including Saudi Arabia and Russia, began talking of an output freeze to ease a supply glut. Although that cooperation never came about, crude prices were later supported by unexpected production outages in Canada, Nigeria and Libya.

John Paulson's hedge fund firm Paulson & Co sold its entire stake of 3.2 million shares in oil exploration and production (E&P) company Whiting Petroleum Corp in the April-June quarter.

That liquidation came amid a 16 percent run-up in the company's stock price over the quarter.

The firm trimmed its bets on E&P companies Cobalt International Energy and Oasis Petroleum, but still kept the stakes sizable at 39.1 million shares and 5.3 million shares, respectively.

The firm largely held on to the Cobalt bet despite a 55 percent drop over the quarter, while Oasis gained more than 28 percent.

These fund SEC disclosures are backward-looking and come out 45 days after the end of each quarter. Still, the filings offer a glimpse into what hedge fund managers saw as investment opportunities.

While Paulson sold, Daniel Loeb's Third Point hedge fund took a new stake in Whiting Petroleum of 8.2 million shares. Barry Rosenstein's Jana Partners also showed a bullish tilt overall and jumped into Marathon Petroleum Corp with a stake of 2.7 million shares.

Leon Cooperman's Omega Advisors took modest positions in E&P companies Antero Resources, Consol Energy, and Pioneer Natural Resources. The hedge fund cut a stake in Targa Resources Corp by 1.6 million shares, however, to 1.1 million shares even as the natural gas pipeline company's stock price rose more than 40 percent.

While some funds showed optimism, David Tepper's Appaloosa Management cut stakes in natural gas master limited partnerships Williams Partners LP and Energy Transfer Partners, along with Kinder Morgan. It exited stakes in E&P companies Southwestern Energy Co, Range Resources Corp and Cabot Oil and Gas Corp as the companies shares rose about 56 percent, 33 percent and 13 percent, respectively.

David Einhorn's Greenlight Capital also appeared bearish and cut his firm's bet on Consol Energy by 7.6 million shares to 22 million shares. It also exited an 887,428 share bet on oilfield services company Oil States International.

Greenlight also soured on renewable energy and sold its entire stake in SunEdison of about 21 million shares.

(Reporting by Sam Forgione; Additional reporting by Barani Krishnan; Editing by Bernard Orr)

By Sam Forgione