Once considered a laggard, the German luxury carmaker is one of only a few established automakers that has been able to compete effectively against Tesla.
It and other foreign automakers are trying to exploit upheaval caused by new technology to gain market share from their dominant rivals.
Daimler, Navistar and Volvo have been criticized for not selling many electric heavy trucks, but the companies say the country first needs many more chargers.
Quarterly earnings soared from a year earlier after the company booked a tax benefit, but increased competition and a price war took a toll, the electric-car maker said.
Elon Musk, the electric car company’s chief executive, said he would “build products outside of Tesla” unless the board raises his stake to 25 percent.
The rental car company blamed the sharp drop in the value of electric vehicles and higher repair costs for its decision to sell 20,000 cars.
The leading electric-vehicle maker also drew buyers eager to take advantage of government incentives that will be harder to get in 2024.
Trevor Milton, who founded the truck company Nikola, will be sentenced on Monday in a fraud case that exposed the excesses in the electric vehicle business.
Purchases of popular models like the Tesla Model 3 and the Ford Mustang Mach-E may no longer entitle buyers to tax savings because the cars do not meet tougher sourcing requirements.
Two years behind schedule, the electric model has an unusual design that sets it apart from rival pickups, which could limit its sales.