The S&P 500 (SPX) added 7 points, or 0.6%, to 1,240 after breaking through a key technical level. The broad market gauge ended at the highest point since September 2008.

The tech-heavy Nasdaq (COMP) rose 21 points, or 0.8%, to 2,637 -- the highest level since December 2007.

For the week, the Dow locked in a gain of 0.4%. The S&P 500 added 1.3%, and the Nasdaq rose 1.5% over the last five days.

The advance came after government data showed that the U.S. trade deficit unexpectedly narrowed in October, raising optimism about economic growth early next year. A separate report on consumer sentiment also came in better than expected.

The trade data "caught people off guard and suggests that the fourth-quarter GDP might look much better than expected," said Dan Greenhaus, chief market strategist with Miller Taback & Co. "But I think the news out of China is the bigger story."

The People's Bank of China further increased its reserve requirement ratio for banks as part of an ongoing effort to cool inflation and avoid an economic crash landing. The move stoked speculation that the central bank could hike interest rates next year.

A separate report showed that China's trade surplus fell 16% in November, as exports surged 35% from the prior month.

Earlier in the week, investors cheered as Washington appeared close to reaching a compromise deal to extend Bush-era tax cuts for another two years. But House Democrats voted Thursday against considering the tax package, which would also provided for extended unemployment benefits and a break in payroll taxes.

The final outcome of the tax debate is "a major source of uncertainty" in the market, said Greenhaus.

On Thursday stocks ended mixed, as a stronger dollar dragged on commodity-related companies, while financial and tech shares firmed.

Looking ahead, investors expect the market to continue to drift modestly higher. "We will continue to move sideways to upwards, which is good," said Chip Brian, chief executive of MySmartrend.com, which analyzes over 6,000 stocks in realtime.

Next week brings a raft of economic reports on retail sales, consumer prices and new home construction. In addition, the Federal Reserve will release a policy statement Tuesday.

Investors will also look to a report on Chinese inflation due over the weekend.

Economy: The U.S. trade balance, which measures the difference between the nation's imports and exports, narrowed to $38.7 billion in October, down 13% from $44.6 billion in September, according to the Commerce Department. Economists were expecting a deficit of $44.5 billion.

The decline brought the U.S. trade deficit to a 9-month low, as exports jumped 3.2% to $158.7 billion, the highest since August 2008, and imports fell 0.5% to $197.4 billion.

The University of Michigan/Reuters index of consumer confidence for early December rose to 74.2 from 71.6 last month. Economists had expected a more modest increase to 72.5, according to consensus estimates from Briefing.com.

Separately, the People's Bank of China said it would lift the bank reserve requirement ratio by one-half percentage points as of Dec. 20. Banks will now have to set aside 18.5% of their reserves, according to Xinhua. This is the sixth such hike this year, as China attempts to put a damper on what "runaway lending amid accelerating inflation."

European stocks were mixed. The DAX in Germany rose 0.5%, while Britain's FTSE 100 and France's CAC 40 were both flat.

Companies: GE announced plans to pay a fourth-quarter dividend of 14 cents per share, up from 12 cents, and said it expects to make "opportunistic share repurchases" next year.

"We are able to increase the GE dividend for the second time this year because of continued strong cash generation, accelerated recovery at GE Capital and solid underlying performance in our industrial businesses through year-end," GE chief executive Jeff Immelt said in a statement.

Community Health Systems (CYH, Fortune 500) announced Thursday that it has made an offer to acquire smaller rival Tenet Healthcare (THC, Fortune 500) for $6 per share, a premium of 40% over Tenet's closing stock price Thursday. An initial offer to Tenet was rejected and this is Community Health Systems' second attempt. Shares of Community Health Systems rose 13%, while shares of Tenet Healthcare surged 55%.

Green Mountain Coffee (GMCR) reported fourth-quarter net income of $27 million, or 20 cents per share, in line with expectations. But shares fell nearly 10% as investors responded to the company's outlook and decision to no longer provide specific guidance about its K-Cup sales.