The stock market enjoyed some Black Friday cheer, rising sharply as shoppers braved the annual post-Thanksgiving rush. Major stock indexes closed one of their best weeks of the year.

Traders were encouraged by positive economic news from Germany and China, two engines of global growth. Technology stocks soared after a few weeks of selling. And early reports from retailers suggested strong consumer spending.

"Foot traffic appears heavier than we've seen in recent years, there are a lot of positive statements out of the companies themselves, and momentum appears to be strong," said JJ Kinahan, chief derivatives strategist at the brokerage TD Ameritrade.

Many stores opened earlier than ever this year, Kinahan said, allowing for earlier informal reports about their performance.

Technology stocks soared, lifting the Nasdaq composite index by more than 1 percent. Dell, chipmaker AMD and Hewlett-Packard were the top three gainers in the Standard & Poor's 500. Technology rose the most among the index's 10 industry groups.

The stocks were bouncing back after confidence in tech stocks declined broadly, Kinahan said. AMD dropped sharply in recent weeks as investors fretted about its solvency. HP plunged 12 percent on Tuesday after executives said that a company HP bought for $10 billion last year lied about its finances.

The Nasdaq ended up 40.30 points, or 1.4 percent, at 2,966.85. The Dow Jones industrial average gained 172.79, or 1.4 percent, to 13,009.69 — the first time since election day that the Dow closed above 13,000.

The S&P 500 added 18.12, or 1.3 percent, to 1409.15. The rally gave the S&P 500 its biggest weekly point gain since last December — 49 points, or 3.6 percent. The Dow gained 3.4 percent and the Nasdaq almost 4 percent for the week.

The market closed early, at 1 p.m. EST.

Stocks started strong after news that German business confidence rose unexpectedly in November after six straight declines. The gain in a closely watched index published by Munich's Ifo institute raised hopes that Europe's largest economy can continue to weather the continent's financial crisis.

China's manufacturing expanded for the first time in 13 months in November, the latest sign that the world's second-biggest economy is recovering from its deepest slump since the 2008 global crisis. HSBC Corp. said its monthly Purchasing Managers' Index improved to 50.4 for November. Any number above 50 indicates expansion.

The PMI measures overall manufacturing activity by surveying indicators including orders, employment and production. The result was released Thursday, when the U.S. market was closed for Thanksgiving.

Around the U.S., shoppers flocked to malls and logged on to computers to take part in the annual cheer-fueled retail rush known as Black Friday.

Target and Toys R Us welcomed buyers on Thanksgiving evening. Retailers are also trying to draw shoppers with free layaway and shipping, by matching prices of online rivals and by beefing up mobile shopping apps.

Retail is a key driver of the nation's economy. Consumer spending accounts for about 70 percent of U.S. economic activity. November and December, which can account for as much as 40 percent of a retailer's annual revenue, are crucial for stores.

The Friday after Thanksgiving is known as Black Friday because it begins the period in which many retailers turn profitable for the year. Traders will be looking for signs about how enthusiastically Americans are spending. That could reflect the momentum of the economic recovery.

Wal-Mart rose $1.31, or 1.9 percent, to $70.20. Macy's gained 72 cents, or 1.8 percent, to $41.73.

Trading volume on Wall Street was light, with many investors away for an extended weekend after Thanksgiving. The rally's strength will be tested on Monday, as many traders return to their desks and retailers begin to release hard data about their holiday sales results, Kinahan said.

"It's great when something like this happens, but on a half-day without the major players in there, it's not so surprising," he said.

European indexes added to earlier gains after Wall Street opened and closed higher. The FTSE 100 index of leading British shares rose 0.5 percent. Germany's DAX and France's CAC-40 both added 0.9 percent.

Investors were monitoring developments in Brussels, where European Union leaders are trying to agree on a $1.25 trillion long-term spending plan for the 27-nation bloc. Markets expect that another meeting will be needed for an agreement.

Among the stocks making big moves:

_ MAP Pharmaceuticals spiked after the company announced that the Food and Drug Administration will review its experimental migraine drug Levadex. The stock rose $2.60, or 20.3 percent, to $15.42.

_ KIT Digital Inc., a video software and technology company, lost two-thirds of its value after the company's former chief executive accused it of blaming prior management for its financial problems. Two days earlier, KIT said it would restate its financial results because of accounting errors. The stock lost $1.33, or 64.3 percent, to 74 cents.

Among tech's big gainers:

_ Research in Motion Ltd. jumped on growing optimism for an earlier-than-expected launch of its delayed BlackBerry 10 smartphone. A senior executive from the Canadian company said earlier this month that Research In Motion, or RIM, will release the latest version of its smartphone "not long after" a Jan. 30 event. One analyst saw that as an indication that the products are to be unveiled in February. U.S.-traded shares of RIM rose $1.40, or 13.7 percent, to $11.66.

_ Dell rose 49 cents, or 5.4 percent, to $9.55.

_ HP added 50 cents, or 4.2 percent, to $12.44.

_ AMD rose 8 cents, or 4.3 percent, to $1.95.

___

Daniel Wagner can be reached at http://www.twitter.com/wagnerreports.