The Dow Jones Industrial Average rose 40.26 points (0.35 per cent) to close at 11,410.32, while the S&P 500 index, a broader measure of the market, climbed 7.40 points (0.60 per cent) to 1,240.40.
The tech-rich Nasdaq added 20.87 points (0.80 per cent) to 2,637.54.
Before the market opened, the Commerce Department reported the US trade deficit shrank in October to the smallest gap since January, thanks to a surge in exports underpinned by a weaker dollar.
The trade gap stood at a seasonally adjusted $38.7 billion, down 13 per cent from a revised $44.6 billion in September.
"The trade balance report for October should certainly help ease the market's fears about the US economy slipping back into recession," said Patrick O'Hare of Briefing.com.
Confidence in the economic recovery was further bolstered after a survey released by the University of Michigan indicated a rise in consumer confidence in November.
"The upbeat sentiment is overshadowing growing concerns about the possibility of a rate hike in China, which today already boosted the reserve requirement for its banks for the third time in five weeks," analysts at Charles Schwab said in a client note.
Stocks staged a late rally after lackluster gains.
"Chinese inflation and the potential for rate hikes out of Beijing left traders somewhat uncertain how to proceed heading into the weekend," said Joseph Hargett of Shaeffer's Investment Research.
In corporate news, US pharmaceutical giant Pfizer announced it is pulling off the market blood pressure drug Thelin due to a potentially life-threatening risk of liver injury. Pfizer shares rose 1.56 percent to $17.02.
Shares in General Electric, one of the Dow's 30 blue-chip stocks, jumped 3.44 per cent to $17.72 after announcing it was raising its dividend for the second time this year and offered a bullish earnings outlook.
And American International Group shares added 2.45 per cent at $48.95. AIG stocks continued to benefit from the insurer's announcement Wednesday of a plan to repay a massive government bailout.
The US bond market fell.
The yield on the 10-year Treasury bond rose to 3.28 per cent from 3.22 per cent on Thursday, while that of the 30-year bond advanced to 4.42 per cent from 4.40 per cent. Bond prices and yields move in opposite directions.
What the stars mean:
★ Poor ★ ★ Promising ★★★ Good ★★★★ Very good ★★★★★ Exceptional