NEW YORK (CNNMoney) -- U.S. stocks sold off late Wednesday to end the day lower on concerns about the debt crisis in Europe and falling oil prices.
The Dow Jones industrial average () fell 77 points, or 0.6%, to end at 12,496. The S&P 500 ( ) fell 9 points, or 0.7%, to 1,315. The Nasdaq ( ) slid 24 points, or 0.8%, to 2,818.
Stocks opened lower and drifted between small gains and losses for most of the day as investors focused on mixed economic reports and Congressional testimony by JPMorgan chief executive Jamie Dimon.
But the selling accelerated in the afternoon as oil prices gave up earlier gains, ending the day down 0.8%. "Oil prices ticked lower and stocks followed," said Ben Schwartz, chief market strategist at Lightspeed Financial.
Meanwhile, ongoing concerns about the debt crisis in Europe continue to weigh on the market.
Investors are worried about Spain, which recently requested up to €100 billion to recapitalize insolvent banks. Egan-Jones cut its credit rating on Spanish government debt to "CCC+" from "B."
Italy has been under pressure amid fears the debt crisis is spreading to the core of the eurozone. Greece is also in focus ahead of a crucial election this weekend.
"There's a lot of nervousness about the Greek election and the euro coming apart," said Schwartz.
Earlier in the day, investors were focused on Capitol Hill, where Dimon told lawmakers that he could not defend the trades that led to the bank's multi-billion dollar loss.
Dimon blamed the loss on insufficient risk controls and a failure by traders to understand the bets they were placing. But he refused to say that JPMorgan was using trades from its chief investment office to make money.
JPMorgan (Fortune 500) shares rose 1.4%.,
Despite the immediate concerns, many investors expect stocks to move higher later in the year. There is widespread speculation that the Federal Reserve will take additional steps to support the economy if conditions continue to deteriorate.
Investment strategists surveyed by CNNMoney said the S&P 500 could rise more than 8% from its current level, which would translate into a 14% gain for the year.
U.S. stocks rose Tuesday, recovering the previous day's losses.
Economy: The Producer Price Index, which measures changes in wholesale prices, dropped 1% in May. Economists surveyed by Briefing.com had expected a decline of 0.7%.
The government's estimates on retail sales for May showed a decline of 0.2%. This was close to what economists surveyed by Briefing.com expected.
Business inventories rose 0.4% in April, which was slightly better than expected.
Philip Morris International (Fortune 500) announced an $18 billion share repurchase plan Wednesday. Shares of the company, which was spun off from domestic tobacco company Altria Group ( , Fortune 500) in 2008, are up 8% year-to-date.,
Shares of Dow component Johnson & Johnson (Fortune 500) were up 2%. The company disclosed after the close Tuesday that it will be able to complete its purchase of Swiss medical device maker Synthes on Thursday, much sooner than expected.,
It also said the deal will add 3 to 5 cents a share to its earnings this year, rather than shave 22 cents a share off its profits as it previously forecast.
World markets: European stocks ended mixed. Britain's FTSE 100 ( ) was little changed, while the DAX ( ) in Germany fell 0.1% and France's CAC 40 ( ) lost 0.7%.
Asian markets ended higher. The Shanghai Composite () gained 1.3%, while the Hang Seng ( ) in Hong Kong rose 0.8% and Japan's Nikkei ( ) ended 0.6% higher.
Oil for July delivery fell 70 cents to settle at $82.62 a barrel. Oil prices have swung wildly lately, due to political and economic uncertainty around the globe. The decline came ahead of Thursday's meeting of the Organization of the Petroleum Exporting Countries.
Gold futures for August delivery rose $5.60 to end the day at $1,619.40 an ounce.
Bonds: The price on the benchmark 10-year U.S. Treasury edged up, pushing the yield down to 1.60% from 1.67% late Tuesday.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||4.07%||4.28%|
|15 yr fixed||3.18%||3.26%|
|30 yr refi||4.05%||4.21%|
|15 yr refi||3.17%||3.18%|
Today's featured rates: