Shoppers lured by deep discounts and early store openings sent sales over the four days starting on Thanksgiving soaring 16.7 percent over the same period a year ago to $52.4 billion, according to the National Retail Federation.

“American consumers are taking a deep breath and making the decision that it’s okay to go shopping again, in spite of high unemployment and uncertainty over the stock market and housing market,” Ellen Davis, vice president of the trade group, said during a media briefing Sunday.

Macy’s, Wal-Mart, Best Buy and Kohl’s were among retailers that opened Thanksgiving night or midnight for the first time, fueling a trend that might set the tone of Black Friday shopping for years.

People spent an average of $398.62 over the four days, up from $365.34 last year, according to the retail federation. The jump in sales reflects, in part, the deluge of 226 million shoppers hitting stores this year, compared with 212 million last year. The numbers reflect in-store and online shopping.

“Midnight is the magic hour for Black Friday shopping,” Davis said. A spokesperson for the Mall of America in Bloomington, Minn., one of the largest malls in the United States, said that “some stores made as much between midnight and 4 a.m. as they made their entire Black Friday last year,” Davis said.

Young adults were driving a hefty portion of those sales. According to a survey conducted by BIGresearch, 37 percent of Black Friday shoppers 18 to 34 years old went out at midnight.

Anticipating an influx of young shoppers at its midnight opening, Macy’s placed more workers at its “younger, hipper stores,” said Kevin Hourican, senior vice president and regional director of stores.

Merchants entered this holiday season with the European debt crisis, weak U.S. economic growth and failed “supercommittee” talks threatening to sour consumers on spending. Consumer spending makes up roughly 70 percent of the U.S. GDP, making the holiday season, when retailers earn as much as 40 percent of their annual sales, a crucial time.

Consumers said that with the high price of gas and other goods, it is a bad time to spend, according to the Bloomberg Consumer Comfort Index. Retail sales only grew 0.5 percent in October, slowing from 0.7 percent in September, according to the Commerce Department. However, in the weeks leading up to Black Friday, ShopperTrak reported sales were up 3.6 percent during the week of Nov. 12 and up 3.8 percent during the week of Nov. 19, compared to last year.

Analysts had projected a 3 percent increase in holiday sales this year, down from the 5 percent growth registered last year. Even with the robust returns of the Thanksgiving weekend, industry insiders are sticking to their seasonal forecasts.

“Black Friday is one piece of the holiday pie,” Davis said, noting that the day typically represents about 10 percent of a retailer’s holiday sales. “Many companies are encouraged by their sales from over the weekend, but Black Friday is not always an indication of the rest of the holiday season.”

All told, 28.7 million people shopped on Thanksgiving, compared with 22.2 million last year, when fewer stores were open on the holiday, according to the trade group.

The stay-at-homes did not forgo shopping, however. Data from IBM Coremetrics show that online sales that day rose 39.3 percent over the previous year, based on real-time information from 500 retailers nationwide.

Black Friday remained the most popular shopping day of the four-day period, as 86.3 million bargain hunters headed out to stores or onto the Internet on that day alone.

Retail research firm ShopperTrak reported that sales Friday rose 6.6 percent over last year to reach $11.4 billion, the largest dollar amount ever recorded for Black Friday. The Chicago-based firm said that Saturday sales waned, which could be the result of more Thanksgiving openings.

“The robust figures are a response to deep discounts and additional sales hours,” said ShopperTrak founder Bill Martin. “Despite the tough economy, consumers are willing to spend money if they feel like they are going to get a value for their dollar.”

Martin said that Black Friday results are “a strong indicator that if the retailers can keep consumers engaged, we should see the growth we predicted.” He also said that “Hanukkah is late this year, so that is going to bring some additional sales on toward that last week before Christmas.”

What’s also encouraging is that only 38.8 percent of consumers surveyed by BIGresearch completed holiday shopping this weekend, meaning there might be more spending in weeks to come.

“Many retailers’ Black Friday sales were a bonus, in that a lot of people were out buying for themselves and making more discretionary, or non-gift, purchases,” Davis said.

As in previous years, clothing and accessories were popular, as were promotions on electronics and computer-related accessories, according to BIGresearch. Department stores remained the most popular destinations, with discount stores following right behind.

Men, representing 56.8 percent of consumers on the bargain hunt, outpaced women in shopping this year, spending an average $484, and women spent an average $317. Sales of men’s apparel at Macy’s outperformed other categories over the holiday weekend.