Ford’s first-quarter earnings beat Wall Street estimates even as the industry grapples with falling sales while investing billions of dollars in new technology to develop autonomous and electric vehicles.

Ford’s stock was up more than 8% in extended trading Thursday.

Here’s how the company did compared with what Wall Street expected, based on average estimates compiled by Refinitiv:

  • Adjusted earnings per share: 44 cents vs. a forecast of 27 cents per share
  • Automotive segment revenue: $37.24 billion vs. a forecast of $37.08 billion

The company’s total revenue was $40.34 billion during the quarter, lower than its $41.96 billion in revenue during the same quarter last year.

“In North America, share and revenue both improved year over year, driven by the performance of franchise strengths in trucks and utilities,” the company said.

On an unadjusted basis, Ford’s profit slid 34% from the year earlier. It earned $1.15 billion, or 29 cents a share, down from $1.74 billion, or 43 cents a share, during the same quarter last year.

Ford shares are up more than 23% year to date; however, they are down about 15% over the past 12 months.

The Detroit automaker said its U.S. North American operating profits were $2.2 billion. Ford only reported operating losses in South America and China. They lost $158 million and $128 million, respectively. Ford also reported operating profits in the Asia Pacific, Middle East and Africa, and Europe.

Outside North America, the company had an operating loss of $196 million, which was an improvement of $632 million from the prior quarter.

“We expect first quarter EBIT to be the strongest of the year due to seasonal factors and major product launches ahead. It does, however, put us on track to deliver better company results in 2019 than last year,” said Ford CFO Bob Shanks in a company release.

The quarterly numbers come amid Ford’s $11 billion restructuring plan, with an aim to slash costs by $14 billion over the next five years. The plan involves focusing on Ford’s historically strongest segments like trucks, utilities, and muscle cars, while scaling back international operations, investing in new technologies, and featuring more profitable vehicles.

Ford announced Wednesday it has invested $500 million in electric truck maker Rivian to build a battery-powered electric vehicle.

The stock closed at $9.41 a share on Thursday.

The company is holding a conference call with CEO Jim Hackett and other executives at 5:30 p.m. ET to discuss the results.

This story is breaking news. Please check back for updates.