Last year was a good for automakers, but it was great one for German automakers, thanks largely to demand in China and the United States -- despite a European economy that’s basically in shambles.

Volkswagen AG (PINK:VLKAY) said Friday that it broke an all-time record for annual sales of its passenger cars, led by robust demand for its latest seventh generation Golf small family sedans.

Overall, the Wolfsburg, Germany-based auto giant said it sold 5.74 million vehicles worldwide in 2012, a 13 percent year-to-year gain from the previous year. It sold more than a half-million units in December, 31 percent more than it did in the same month the previous year.

VW sales were up 25 percent in China compared with the previous year. In fact, nearly four out of every 10 Volkswagens purchased last year were bought in the rapidly expanding Asian giant, where 2.15 million units were sold. U.S. sales expanded 35 percent to 438,100 units.

However, Western Europe was a dud, where deliveries (excluding Germany) contracted by 6.9 percent.

Audi AG (FRA:NSU), which is owned by Volkswagen, reported strong double-digit growth on Thursday in all market  segments except Europe; excluding Europe, global sales rose between 18.5 percent in the U.S. (on the low end) and 63 percent in India (on the high end). In all it sold 1.45 million units worldwide, giving the company's sales a nearly 12 percent spike. Its China sales surpassed 400,000 units for the first time.

Despite its great sales performance last year, the company is circumspect about its 2013 prospects as the global economy is expected to slow.

“2013 will be a very demanding year, and we will be facing new and difficult challenges,” said Christian Klingler, VW board member for sales of passenger cars. “But we are well prepared."

Bayerische Motoren Werke AG (FRA:BMW) of Muenchen, Germany, also reported record global sales for its core business as well as its smaller U.K.-based Rolls-Royce and Mini brands. Group-wide, BMW delivered 1.85 million units last year, an 11 percent gain compared with its sales in 2011, despite what the company said were “challenging” times.

Ian Robertson, BMW director of sales and marketing, was not as cautious as VW in his comments about this year’s prospects, saying the company envisions breaking last year’s sales record “despite the prevailing headwinds in some markets.”

The BMW brand sold customers 1.5 million vehicles last year, up from 1.4 million the year before, led by sales of the 1-series compact family car, which saw sales spike nearly 29 percent to nearly 227,000 units, and the  BMW X3 crossover, which saw sales climb 27 percent, to nearly 150,000 units.

Sales of the Mini retro compact also broke a record with just over 300,000 vehicles sold, marking a 5.8 percent rise from the previous year, while the Rolls Royce Phantom Series II, which was unveiled in Geneva last March, helped the ultra-luxury brand break annual sales records for a third consecutive year.

Unlike Volkswagen , BMW managed to eke out a 1 percent gain in European sales. Russian sales grew by the largest margin, 33 percent, followed by 32 percent in Asia and 14 percent in the U.S.