U.S. stocks rallied on Thursday, breaking a six-day losing streak, as market sentiment was boosted by an upbeat trade report and higher oil prices.
Thursday's rally came after a week-long sell-off, which made many investors think the market has been technically pretty much over sold.
Traders were encouraged after the Commerce Department said the U.S. trade deficit unexpectedly narrowed in April due to record- high exports.
Data showed U.S. companies sold more computers, heavy machinery and telecommunications equipment overseas while imports declined, largely because purchases of goods from Japan dropped significantly in the aftermath of the earthquake and tsunami.
Basic materials and energy shares were among the leaders in the market as crude oil jumped to nearly 102 dollars a barrel in New York, buoying related stocks.
Meanwhile, report on new austerity measures approved by Greek cabinet also helped investors shrug off a tepid jobs report.
According to the Labor Department, the number of people applying for unemployment benefits rose 1,000 to 426,000 in the week ended June 4, while analysts were expecting a slight drop.
The Dow Jones industrial average rallied 75.42 points, or 0.63 percent, to 12,124.36. The Standard & Poor's 500 gained 9.44 points, or 0.74 percent, to 1,289.00. The Nasdaq Composite Index rose 9.49 points, or 0.35 percent, to 2,684.87.