Heavy rains in May and a slumping oil industry put a damper on the second-quarter results of H&E Equipment Services Inc., a Baton Rouge-based construction equipment supplier.

H&E’s profit dipped to $11.5 million, or 33 cents per share, compared to $15.7 million, or 45 cents per share, a year ago.

An increase in equipment rental revenue of close to 10 percent partially offset a $26 million drop in new equipment sales. But total revenue slipped to $262.4 million compared to $280.4 million a year ago.

Despite the extreme weather and a soft oilpatch, H&E managed to beat Wall Street’s expectations. Analysts surveyed by Zacks Investment Research had forecast earnings of 32 cents per share.

H&E’s stock surged nearly 24 percent, or $3.35, to $17.56 on Thursday. Its 52-week trading range is $13.47 to $42.38.

H&E Chief Executive Officer John Engquist said most market indicators remain positive.

The company expects the recovery in the commercial construction markets will continue to accelerate through the rest of 2015 and into 2016, he said. Commercial construction will help offset the weakness in the oil and gas industry.

However, because of the oil and gas industry’s downturn and the unusually wet spring, H&E is lowering its full-year projections. The company now expects 2015 revenue in the range of $1.03 billion to $1.05 billion. In April, H&E had estimated revenue of $1.07 billion to $1.09 billion.

H&E is now projecting earnings before income tax, depreciation and amortization — an indicator of financial performance — in the range of $319 million to $335 million. In April, H&E had forecast a range of $334 million to $352 million.

Follow Ted Griggs on Twitter @tedgriggsbr