Ford Motor Co reported a better-than-expected quarterly net profit on Thursday, driven largely by U.S. sales of its high-margin pickup trucks, and said it would begin to test self-driving cars in some cities next year.

A large part of the company`s profits came from its F-Series pickup trucks, which have been the best-selling vehicle in North America for decades. Ford said the average transaction price for its trucks rose $2,800 to $45,400.

The company redesigned its larger F-series Super Duty pickups a year ago, and recently updated its standard F-150 trucks for model year 2018.

Ford said its North American margin rose to 8.1 percent from 5.8 percent a year earlier. Earlier this week, GM reported a third-quarter margin for North America of 8.3 percent.

Ford plans to begin testing self-driving vehicles in some cities in 2018, Chief Executive Officer Jim Hackett disclosed on an earnings call with analysts on Thursday, but gave no details.

Ford also is developing new business partnerships with unnamed companies to use its self-driving vehicles in commercial applications other than ride hailing, Hackett said. He declined to confirm whether Ford still planned to put those vehicles into service by 2021, executives have said.

Rival General Motors Co said in recent weeks it plans to accelerate the commercial application of its self-driving Chevrolet Bolts, some of which could be in operation before 2020. GM also plans to introduce 20 electric vehicles by 2023.

Year to date, GM`s stock is up nearly 30 percent, while Ford is down almost 1 percent. In mid-morning trade, Ford was up 0.3 percent to $12.08.

Wall Street has been underwhelmed by Ford, particularly by Hackett`s caveat that most of the company`s $14 billion in planned cost savings will not show up on Ford`s bottom line until 2019 and 2020.

When asked by reporters about the flagging stock, Chief Financial Officer Bob Shanks said Ford has a "really good plan" for electric vehicles and self-driving car technology.

"I think the market will reward us," he said.

On the earnings call on Thursday, Shanks said Ford will "aggressively restructure the business as required to achieve our objectives ... We are prepared to do what we have to do."

He did not provide details.

Apart from North America, the only other region that was profitable for Ford was Asia Pacific, where a record profit was driven by sales increases outside China. CFO Shanks said sales volumes, market share and margins were all down in China.

He said Ford`s European operations would return to profitability in the fourth quarter and for the full year.

Ford said it had lower engineering, advertising and promotion expenses than in the third quarter.

The second largest U.S. automaker posted a quarterly net profit of $1.56 billion, or 39 cents per share, up more than 60 percent from $960 million, or 24 cents, a year earlier.