A strong stock market in 2021 meant that the chief executive officers of automakers made substantially more in 2021 than they did the year before. Unsurprisingly, Tesla CEO Elon Musk was the biggest winner last year.

According to a study commissioned by Automotive News, Musk made $23.5 billion in 2021, which made him the highest paid chief executive at a publicly traded U.S. company in the automotive industry.

“In 2021, the economy was doing very well and the stock market was doing very well and that’s reflected in the gains that executives saw this past year,” Courtney Yu, the director of research at Equilar, which conducted the study, told Automotive News. “In the case of Elon Musk, if you decided to exercise stock options, to the tune of over $23 billion, it was definitely a good year for people owning equity.”

Read Also: Stellantis CEO Carlos Tavares Comes Under Fire For 2021 Pay Which Unions Call “Indecent And Revolting”

Musk was far from the only CEO whose pay increased last year. Across all automakers, CEO compensation rose by 78 percent in 2021 and the median for all CEOs was $12.3 million, up from 2020, when it was $6.9 million. For CEOs who had been in their position for at least two years, meanwhile, median compensation actually rose by 90 percent.

Mary Barra, the third-highest paid automaker CEO on the list, earned $62 million in 2021, up from $40 million a year earlier. Peter Rawlinson, meanwhile, who has been Lucid’s CEO since 2019, made $67 million.

It wasn’t just automakers, though, whose CEOs made more in 2021. The study also looked at suppliers, whose compensation more than doubled over a year earlier as they navigated parts shortages.

Jensen Huang, the CEO of Nvidia, made $560.9 million in compensation last year. Like Musk, though, much of that was driven by stock options, which accounted to $506.8 million of his total compensation in 2021.

Companies in the mobility and technology sector, such as Uber and Lyft, were the only ones in the industry where CEO compensation went down in 2021.