People flocked to buy video games in October despite a drop in consumer confidence to a historic low, spending $1.31 billion in U.S. retail stores on hardware, software and accessories.

That's a gain of 18 percent from the same month a year ago, according to data from market researcher NPD Group.

Hardware sales climbed 5 percent to $494.7 million, led by the Nintendo Wii, which far outsold every other game machine.

Cammie Dunaway, an executive vice president at Nintendo, said it was the biggest October ever for the Wii, which sold 803,000 units during the month.

The $250 console has been plagued by retail shortages since its launch two years ago, but Nintendo recently boosted production levels.

• Click here to visit FOXNews.com's Video Gaming Center.

While the Wii continues to sell out quickly, Dunaway said consumers who pay attention to ads and visit stores early in the week should be able to grab one.

Microsoft Corp.'s Xbox 360 sold 371,000 units. The console's sales were boosted by a significant price cut in early September.

Microsoft spokesman David Dennis said he remains "cautiously optimistic" about the holidays, when video game companies make most of their money.

Sony Corp.'s PlayStation 3 sold 190,000 units.

Software sales grew 35 percent to $696.8 million, while sales of accessories, which include peripherals for music games like "Guitar Hero," declined 8 percent to $120.3 million.

Microsoft's epic role-playing game "Fable II" was the month's best-selling title with 790,000 units sold, followed by Nintendo's "Wii Fit" exercise game with 487,000 copies.

Other games in the top 10 included Sony's "Little Big Planet," Nintendo's "Wii Play" and "Mario Kart" for the Wii, as well as "Fallout 3" from Bethesda Softworks and "Rock Band 2" from Electronic Arts Inc. and MTV.

The games industry is optimistic about the coming weeks even amid bad news from electronics retailers, with Circuit City filing for bankruptcy and Best Buy Co. slashing its guidance and calling the current retail climate the worst it's ever seen.

Video games, Dunaway said, continue to be attractive to consumers in part because of their relatively low price compared with other forms of entertainment.