FRANKFURT, Germany — It’s ironic: Volkswagen spent 2016 battling a huge scandal over cars it rigged to cheat on emissions tests.

Now it stands a decent chance to pass Toyota for the title of world’s biggest carmaker for the year.

Booming business in China helped Volkswagen increase its sales to 10.31 million vehicles last year across all its brands, which include Audi, Porsche and Skoda, the company said Tuesday. That was an increase of 3.8 percent over 2015, when Volkswagen came in second to Toyota. And a strong finish to the year in December – 11.8 percent better than the same month the year before – improves the company’s chances of moving from No. 2 to No. 1 in global sales.

That Volkswagen is even in the running for top spot seems remarkable considering how terrible the year was on the legal and image front.

The scandal news kept coming this week as Oliver Schmidt, Volkswagen’s former head of U.S. environmental compliance, was arrested in Florida and appeared in a Detroit court in prison garb and shackles. Engineer James Liang had earlier pleaded guilty and offered to assist federal law enforcement in their investigation.

Despite all that, huge demand in China may be enough to push Volkswagen past its Japanese rival and Detroit-based General Motors. Neither rival has reported 2016 sales yet. For 2015, Toyota Motor Co. came in first with 10.15 million, Volkswagen was second with 9.93 million, and GM third with 9.8 million.

Volkswagen’s improved sales show how crucial China has become for Germany’s carmakers, including BMW and Daimler. Of the three, Volkswagen is the most dependent on China. It sold 3.98 million cars there last year, more than a third of its total unit sales.

Volkswagen was barely behind Toyota after 11 months of 2016, but China in particular fueled the strong December. U.S. sales, which are much smaller, were off 2.6 percent for the year.

To add a layer of irony, overtaking Toyota would come only after Volkswagen abandoned its goal of achieving global supremacy in raw sales numbers.

Dethroning Toyota was part of the company’s Strategy 2018 pushed by CEO Martin Winterkorn, who lost his job due to the scandal. But the new CEO, Matthias Mueller, has dropped that emphasis on unit sales in the latest strategy, amid concerns it fostered a management culture that could have helped create the emissions scandal. The new plan focuses more profitability and a greater emphasis on electric vehicles, digital services such as car-sharing and ride-hailing. Toyota also downplays the sales race.

Other factors helping Volkswagen sales: The company’s other brands, particularly Audi, Porsche and Skoda, helped make up for any weakness at the namesake grand.

And Volkswagen didn’t sell many cars in the first place in the U.S., where the scandal first broke in September, 2015.

“China is the big equalizer,” Ferdinand Dudenhoeffer, director of the CAR-Center Automotive Research at the University of Duisburg-Essen, said in an email. “Diesel plays no role there, so your reputation can’t suffer. China today is the center of the automotive world, for Volkswagen as well.”

“And when you look more closely at the numbers, Volkswagen didn’t lose so much in the end in Europe, because Audi and Skoda were able to buck the trend a little.”

After a strong last quarter of the year in China, where Volkswagen is stronger than Toyota, “Volkswagen would have to have the edge,” Dudenhoeffer said.

For decades, Volkswagen has steadily grown its business in China. High-end offerings such as Porsche, Lamborghini and Bentley vehicles are imported, but the company has a large presence on the ground making cars specifically for the mass market. Its joint-venture agreements with its local partners, SAIC Volkswagen and FAW-Volkswagen, date to 1984 and 1990.

Comments are not available on this story.