Global technology stocks have rallied for a third straight session, fueled by strong earnings from the electric car and smart technologies industries.

Amber, a maker of battery-powered vehicles, was the top performer in the S&P 500, rising 14.7% to $19.99.

The energy giant was followed by Nvidia Corp., which gained 5.5% to close at $5,200, while the maker of artificial intelligence software was up 1.2% to around $4,100.

Wall Street was largely optimistic on the outlook for electric cars and other energy technologies, after a record of gains last year prompted a global rush to plug up vehicles and cut the use of fossil fuels.

Tesla, a California-based electric car maker, gained 7.2%, its biggest gain in more than a year.

The company said on Monday that it would begin shipping cars in 2018 with all-electric drivetrains.

Nvidia said in a filing with the Securities and Exchange Commission that it expects to earn $10.6 billion in 2018, up from $10 billion last year.

It is also investing $50 million to expand its manufacturing plant in the Detroit suburb of Flint, Michigan, and in a joint venture with Ford Motor Co. for electric trucks.