A boom in electric vehicles is stoking demand for a wide range of metals, a shift some investors believe will have a far-reaching impact on commodity prices around the world.

Investors eager to get in early have doubled the price of lithium and cobalt—key components of electric-car batteries—in the past two years. Shares of companies that claim to sit on deposits of the metals have soared this year, too, even though some have yet to bring any production to market.

Many investors also have found fresh reasons to love some of the better-known metals, which are used more heavily in electric and hybrid vehicles than in ordinary cars. Prices for nickel, copper and other base metals have hit multiyear highs in 2017, although some have receded in recent weeks.

Meantime, analysts expect a host of minor metals such as manganese, vanadium and molybdenum to become more important in coming years.

It’s a bet that coincides with Tesla Inc.’s soaring market value and bitcoin’s surge; the latest wager tied to disruptive technology with uncertain ramifications. As more countries pave the way for electric vehicles to supplant gasoline-powered ones, the most bullish investors are convinced the world is about to experience its biggest shift in commodities demand since the 19th century, when petroleum replaced whale oil as lamp fuel.