NEW YORK — Stocks fell for the fourth straight day Tuesday following a profit slump at technology companies and a steep decline in oil prices, which sent energy stocks sharply lower.

The Dow Jones industrial average fell 83.17 points to close at 12,653.12. Aluminum maker Alcoa was the biggest loser in the Dow, giving up 4 percent after reporting a slump in revenue late Monday.

The broader Standard & Poor's 500 lost 10.99 points to 1,341.47. The index is in its longest slump since May 18.

Chip maker Advanced Micro Devices fell sharply after reporting that a slowdown in China and Europe led to an 11 percent drop in second-quarter revenue. The company had previously forecast a gain of 3 percent.

That news sent other technology stocks down hard. The tech-heavy Nasdaq composite dropped 1 percent, the most of the three major indexes. It closed 29.44 points lower at 2,902.33.

The bad news outweighed hopeful developments in Europe earlier in the day. Before U.S. markets opened, European finance ministers announced they had agreed on the terms of a bailout for Spain's banks. The first installment of $37 billion in aid can be ready by the end of the month.

Investors were concerned that some details seemed to be missing from the plan.

Also weighing on the market: worries about a slew of upcoming corporate earnings reports. Financial analysts expect that earnings at companies in the S&P 500 fell 2 percent in the April-through-June period compared with a year ago, according to S&P Capital IQ. That would be the first drop in nearly three years.

"The past quarter was great, but going forward many companies may have problems," said Joe Kinahan, chief derivatives strategist at TD Ameritrade, a brokerage. "People are confused about what to think."

A resolution to a labor dispute in Norway early Friday weighed on oil prices, which pushed energy stocks lower. Early Tuesday, the Norwegian government intervened to end a strike that threatened North Sea oil production.

Benchmark crude oil fell $2.08 to $83.91 a barrel in New York. Major energy companies dropped as a result, including Occidental Petroleum, down $1.95 at $83.24, and ConocoPhillips, down 90 cents at $53.43.

Natural gas producers took a hit from a sharp drop in the price of natural gas, which was down 5 percent at $2.74 per 1,000 cubic feet. Cabot Oil & Gas slumped $1.20 to $39.07 and Chesapeake Energy gave up $1.29 cents to $18.69.

Also weighing on commodities was a report from China that import growth fell in half in June from May, a signal its economy may be slowing more than expected. The Chinese economy, the world's second biggest, is growing at its slowest pace since the 2008 financial crisis.

Copper fell 1 percent to $3.40 per pound. China is a big importer of the metal.

In stocks, the selling was broad. Eight of the ten industry groups in the S&P 500 fell. Industrial companies led the declines with a slump of 1.6 percent. Utilities and consumer staples, industries that fare better than others when the economy is struggling, rose slightly.

In Europe, the deal to aid Spain helped push the yield on its benchmark 10-year government bond down to 6.8 percent. On Monday, that country's key borrowing rate surged to 7 percent, a dangerously high level. The lower yield means investors are less fearful about the country having trouble paying its debts.

Portugal, Ireland and Greece all had to ask for help from international lenders after spikes in their own borrowing rates made it unaffordable for them to raise money from selling bonds on the open market. Spain is the largest European country to date to seek international assistance.

In corporate news, Applied Materials, which makes equipment for chipmakers, cut its fiscal year profit and sales estimates because of weak demand. The stock fell 30 cents to $10.71. AMD, the chip maker hurt by slumping sales in China, plunged 63 cents to $4.99.

Embattled BlackBerry maker Research in Motion fell 38 cents to $7.29. The company's CEO, Thorsten Heins, told a shareholders meeting that he isn't satisfied with the company's performance. Two weeks ago the company announced disappointing earnings, plans to cut 30 percent of its workforce and the latest delay in BlackBerry 10.

Alcoa lost 36 cents to $8.40 after a financial analyst cut his estimate for the company's 2012 earnings. Alcoa reported Monday that it beat analyst estimate for earnings in the second quarter but that revenue dropped due to slowing world demand for aluminum.

Two stocks fell for every one that rose on the New York Stock Exchange. Volume was lighter than average at 3.4 billion shares.