Polaris Industries Inc. posted record third-quarter sales and much-improved profits, with help from an acquisition and significant improvements to off-road vehicle sales.

The results handily beat Wall Street expectations and improved enough that executives boosted its earnings guidance for the rest of the year. As a result, Polaris shares closed at $123.18, up more than 15 percent and at the highest level in more than two years.

“Our emphatic return to profitable growth in the third quarter was a testament to the power of the Polaris brand, the strength of our dealer network and the competitive drive of the Polaris team,” CEO Scott Wine told analysts during a conference call Tuesday. “During the quarter, strong retail growth in both North America and nearly all of our international markets drove record sales and highlighted our ongoing product innovation, improving product quality and sharpened execution.”

The surge in off-road sales — up 12 percent during the quarter — is a positive sign for Polaris, which has struggled for three years with product recalls stemming from fire and other mechanical hazards, mostly associated with its four-wheel products. Some mechanical problems have allegedly resulted in injuries, deaths and property damage and prompted multiple lawsuits.

In three years, Polaris recalled more than 432,000 vehicles, spent millions on warranty claims and lawsuits and launched exhaustive investigations to find and fix potential engineering and design problems. Warranty costs had shot to about 4 to 5 percent of annual sales but are falling closer to 3 percent so far this year. Those costs are expected to drop more, CFO Mike Speetzen said during the analyst call.

Polaris reserved $112 million in warranty costs during the third quarter, down from $130 million for the year-ago period.

Still, the company is not completely out of the woods just yet.

Polaris’ latest recall was last week, when it recalled 6,300 of its ACE 325 recreational off-highway vehicles.

In its Oct. 17 report to the U.S. Consumer Product Safety Commission, Polaris said it received six reports from customers about the cracking of an exhaust header pipe and two reports of melted seats. There were no reports of injury. But the concern, officials said, is that a cracked pipe could release hot exhaust gases into the engine compartment and potentially cause fires or burns.

For the quarter ending Sept. 30, the Medina-based maker of off-road four-wheelers, motorcycles, snowmobiles and accessories reported that sales jumped 25 percent to a record $1.48 billion. The Transamerican Auto Parts retail chain it bought late last year added $190 million in sales for the quarter.

Net income rose to $81.9 million, or $1.28 per share, more than doubling the $32.3 million, or 50 cents per share, reported for the 2016 third quarter. The bottom line included costs for winding down its Victory motorcycles line, integrating Transamerican Auto Parts, promotional spending designed to reduce inventory and the closing and relocation of its Milford, Iowa, plant, the company said.

Adjusted for those one-time costs, the company’s earnings were $1.46 per share, well above the $1.23 per share that analysts expected. Analysts had forecast sales of $1.4 billion.

Wine added that the strong sales environment boosted the bottom line.

“Despite higher-than-expected costs for warranty and rework and complications from hurricanes Harvey and Irma, we delivered significant operating profit growth and earnings per share expansion for the quarter,” Wine said. “With strong growth in revenue, profitability and cash flow I feel very good about the performance of the Polaris team and our improved outlook for the fourth quarter and beyond.”

Polaris raised its full-year guidance for 2017. Adjusted net income is now expected to be in the range of $4.75 to $4.85 per share. That’s up from the prior forecast of $4.35 to $4.50 per share. The company recorded 2016 net income of $3.48 a share.

Adjusted sales, excluding Victory, are now expected to grow 18 to 19 percent over 2016 revenue of $4.52 billion; the previous forecast was an increase of 12 to 14 percent.