Cramer: This is what BP’s quarter is telling other oil firms

BP's message to other oil companies in the first quarter was loud and clear, CNBC's Jim Cramer said Tuesday.

"A lot of companies felt it was better to split up refining and marketing and exploration production," Cramer said on "Squawk on the Street." "Well BP is telling you that is not the thing to do, because they were saved by refining and marketing. [This was] a much better-than-expected quarter."

Shares of the U.K.-based oil giant advanced 5 percent Tuesday. The stock hit a new 2016 high after beating analyst expectations.

BP posted an 80 percent year-on-year fall in core earnings for the first quarter, when oil prices touched a near 13-year low, but the result was better than analysts had expected.

BP's quarterly underlying replacement cost profit, the company's definition of net income, was $532 million in the first three months of the year, compared with a forecast loss of $140 million in analyst consensus figures provided by BP.

— Reuters contributed to this report.