Higher prices and strong electric vehicle sales helped German automaker BMW beat analysts’ forecasts on Wednesday with a 42.4% year-on-year increase in third quarter net profit to 2.58 billion euros ($2.99 billion).

The premium automaker, which said earlier this year it expected to deliver up to 90,000 fewer cars in 2021 because of a global shortage of semiconductor chips, saw deliveries fall 12.2% in the third quarter but still boosted revenues by 4.5%.

Electric vehicles in particular saw a significant boost, with sales in the nine months to September almost double last year’s levels at just under 232,000 vehicles.

“A better product mix and good price setting of new vehicles alongside a stable pricing trend of used vehicles strengthened the financial performance of the business,” a company statement said, reporting an operating profit (EBIT) margin in its automotive division of 7.8%.

Automakers from Volkswagen to Stellantis to Renault reported dampened third quarter sales due to scarce chip supply. Companies able to offset losses through higher prices – such as BMW rival Daimler – fared better than others.