General Motors Co. plans to have its self-driving cars ready for a ride-share service within two years as the automaker looks beyond traditional car ownership for new tech-driven sources of revenue.

After spending more than a year quietly putting the pieces in place to launch a robotaxi business, GM said Thursday it expects to be ready in 2019 to have a fleet of self-driving cars in operation. The sharing service could be run by the automaker or a partner.

The more than a century-old manufacturer is pushing to be a major player in a future self-driving taxi business at a time when ride-hailing is growing and auto sales in its home market are slowing. GM is trying to position itself to cash in on a potentially lucrative business that could offer a major new source of revenue and improved margins, especially since going driverless could dramatically reduce costs.

“It’s a big opportunity,” GM President Dan Ammann said in an interview in San Francisco this week. “We think it will change the world.”

Ride-hailing services on the roads now, including those offered by Uber Technologies Inc. and Lyft Inc., cost consumers about $2 to $3 a mile, with the companies paying their drivers the equivalent of about three quarters of revenue, GM estimates. Take away driver costs and the rates could drop to below $1 a mile, said Kyle Vogt, chief executive officer of Cruise Automation, the San Francisco-based unit that develops the software for GM’s self-driving cars.

Uber, Waymo

The outlook for when GM thinks it’ll have a self-driving service ready roughly coincides with when Uber will begin taking delivery of 24,000 sport utility vehicles from Volvo Cars expected to be capable of piloting themselves. Waymo, the autonomous car unit of Google parent Alphabet Inc., earlier this month said it’s about to start chauffeuring people in Fiat Chrysler Automobiles NV-supplied minivans without safety drivers manning the steering wheel.

GM hasn’t yet said whether it will operate the service itself or pair up with the likes of Uber or Lyft, which it invested $500 million in last year.

As the cost of hailing a ride to the consumer falls, “the size of the market could grow 500 or 1,000 times,” Vogt said in an interview. Earlier this week, GM showed off its self-driving Bolt to analysts and media to display its capabilities on the busy public streets of San Francisco.

Minimal Maintenance

GM is trying to create self-driving cars that need minimal maintenance and upkeep, like aircraft that hold up well to constant use, Vogt said. That’s one reason Cruise has used the battery-powered Bolt for self-driving technology: Electric cars have fewer mechanical parts and should require less maintenance, he said.

The automaker’s aggressive push into self-driving cars, electric drive and ride-sharing has been a key reason why the stock has soared in recent months. GM shares rose 26 percent this year through Wednesday’s close, compared with a 4 percent gain for crosstown rival Ford Motor Co. The stock slipped 0.8 percent to $43.44 as of 12:20 p.m. Thursday in New York.