Navistar International (NAV) posted a smaller second-quarter loss amid a rebound in truck sales.

Navistar has incurred significant costs tied to warranty claims and a transition to a new emissions treatment system for its engines, causing the company to book a string of quarterly losses.

The commercial truck maker’s loss for the period ended April 30 narrowed to $297 million from $374 million in the year-ago quarter. On a per-share basis, Navistar reported a loss of $3.65 versus $4.65. The latest period included $151 million in write-downs, mostly from the company’s operations in Brazil.

Revenue rose 8.7% to $2.75 billion, just ahead of Wall Street’s consensus estimate of $2.72 billion. Analysts were looking for a smaller per-share loss of $1.31.

Lisle, Ill.-based Navistar, which failed to meet tougher U.S. emissions standards for about three years, switched to the same treatment system used by the rest of the industry in 2012. The company has also been hit by warranty claims on a new 13-liter engine.

Navistar also reached a deal last year to have Cummins (CMI) supply exhaust-treatment components and heavy-duty truck engines.

Chief executive Troy Clarke said Navistar saw its market share “bounce back strongly in the second quarter.” The company also recorded a year-over-year improvement in orders.

The company’s North America truck division more than halved its loss to $134 million. The North America parts segment lifted its profit by $12 million to $126 million, although revenue declined by 2%. Navistar said lower military sales were partially offset by higher commercial parts demand.

Shares rose 26 cents, or 0.7%, to $35.71 in recent trading.

Follow Matthew Rocco on Twitter @MatthewRocco