What happened

Shares of Oceaneering International (NYSE:OII) surged in July ending the month up 10.7% after receiving a quick rating upgrade and reporting expectation-beating second-quarter results.

So what

On July 20th, Seaport Global upgraded Oceaneering from sell to neutral stating that the offshore service company was its preferred name in the deepwater service market. What's noteworthy about this rating change is that it came about a month after Seaport Global downgraded Oceaneering and 50 other oil stocks after it threw in the towel on the oil market. However, with the oil market showing some signs of improvement, Seaport reversed its downgrade on Oceaneering after watching the stock jump nearly 10% in the month that followed its capitulating call on the sector.

An Offshore Jack Up Rig with a rainbow.

Image source: Getty Images.

About a week later Oceaneering reported its second-quarter results, which were much better than analysts expected. Revenue came in at $515 million, which was 15% higher than the second-quarter of 2016 and beat the consensus estimate by more than $26 million. Meanwhile, the company eked out a small profit of $2.1 million, or $0.02 per share, which was not only an improvement from its year-ago loss of $0.08 per share but came in $0.03 per share ahead of expectations. Further, the company noted that it had inked several long-term contracts in the quarter, which should boost results in future periods. Though, the company stated that it still only expects to be "marginally profitable" this year.

Now what

The market had become a bit too bearish on Oceaneering, which at one point had fallen more than 25% this year. While it recovered some of that in July, it's still down about 8% this year and more than 60% since the downturn started three years ago. That suggests that there's more upside ahead as the market recovers, though it could be a slow climb because deepwater drilling is just starting to pick back up and could remain weak for a while given where oil is these days.

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.