Stocks rose and the Dow reached a four-month high Tuesday as better-than-expected earnings from companies including Merrill Lynch and IBM encouraged investors to buy equities.

The Dow Jones industrial average (search) rose 71.57 points, or 0.68 percent, to close at 10,646.56. The Standard & Poor's 500 Index (search) gained 8.22 points, or 0.67 percent, to end at 1,229.35. The technology-laced Nasdaq Composite Index (search) climbed 28.31 points, or 1.32 percent, to close at 2,173.18.

In regular trading, shares of IBM (IBM), the world's largest computer company, jumped 2.3 percent to $83.70 on the New York Stock Exchange (search) and boosted the blue-chip Dow average. And shares of Merrill (MER), the largest U.S. brokerage, gained 2.3 percent to $57.98 on the NYSE.

"It's still early, but it's been a good earnings quarter so far," said Barbara Marcin, manager of the $40 million Gabelli Blue Chip Value Fund at Gabelli Asset Management in Rye, New York. "We've had a solid economy, good fundamentals. So if earnings continue to be good, there should be some upside" for stocks.

The strength in IBM helped lift shares of tech companies Microsoft Corp. (MSFT), Apple Computer Inc. (AAPL) and Yahoo (YHOO). Microsoft rose 2.4 percent to $26.16, Apple climbed 4.1 percent to $43.19, and Yahoo advanced 3.1 percent to $37.73.

But after the closing bell, shares of Intel (INTC), the world's largest chip maker, declined following the company's report that its quarterly earnings met Wall Street estimates, while gross margins were below expectations. Intel shares fell 3.5 percent to $27.72 on the Inet electronic brokerage. The stock closed on Nasdaq at $28.71, up 1.7 percent.

Yahoo shares sank more than 9 percent to $34.30 on Inet from a Nasdaq close at $37.73.

Mark Mahaney, an analyst at Citigroup Smith Barney, said Yahoo shares took a beating in after-hours trading as the results matched, but did not exceed investor expectations.

"The stock has had a big run-up," Mahaney said. "People were talking about a big upside and this was an in-line quarter."

Bonds rose, with the yield on the 10-year Treasury note falling to 4.19 percent from 4.22 percent late Monday. The U.S. dollar was up against other major currencies in European trading. Gold prices were unchanged.

Crude oil futures rose. A barrel of light, sweet crude settled at $57.46, up 14 cents, on the New York Mercantile Exchange (search).

In the closely watched housing market, Commerce Department (search) data showed construction of new homes and apartments was flat in June, providing an indication that the red-hot housing market may be cooling off. June's performance was far below the 1.1 percent increase private economists had been expecting.

Adding to robust earnings sentiment were expectations that Federal Reserve Chairman Alan Greenspan (search) will deliver optimistic testimony on the U.S. economy on Wednesday -- giving investors further reason to buy stocks, said Jeffrey Saut, Raymond James Financial chief investment strategist.

Greenspan, who is due to retire early next year, will give what is expected to be his last biannual economic reports to U.S. House and Senate committees Wednesday and Thursday.

Beleaguered auto maker Ford Motor Co. (F) beat analysts' estimates, even as its earnings fell 19 percent from the year-ago quarter. It affirmed its guidance for the full year. Ford fell 9 cents to $10.84.

Computer maker Hewlett-Packard Co. (HPQ) said it will cut 14,500 jobs, about 10 percent of its full-time staff, as part of a plan designed to save $1.9 billion annually. The job cuts, which will occur over the next six quarters, will mostly come in support functions. HP fell 40 cents to $24.52.

International Paper Co. (IP) gained 5.1 percent, or $1.56, to $32.22 on the NYSE after the forest-products company said it plans to spin off some businesses. Other paper industry stocks rose, including Georgia-Pacific (GP), up 4.9 percent, or $1.58, at $33.66, and Weyerhaeuser Co. (WY), up 2.8 percent, or $1.81, at $66.12.

Shares of industrial companies such as Caterpillar Inc. (CAT), a Dow component, and Tyco International Ltd. on expectations that other companies in the sector will report healthy earnings this week. Caterpillar's stock gained 5.1 percent, or $2.58, to $53.40 while Tyco shares added 3.7 percent, or $1.09, to $30.88, both on the NYSE.

Wachovia Corp. (WB) fell $1.27 to $49.73 after missing analysts' estimates by a penny and reporting its assets were relatively flat with the end of December.

Wells Fargo & Co. (WFC), the fifth-largest U.S. bank, fell 16 cents to $61.83 after reporting its second-quarter earnings rose 11 percent from last year, driven by strong loan and deposit growth. The results were a penny shy of Wall Street expectations and its home mortgage business dropped $559 million in revenue.

Bonds rose, with the yield on the 10-year Treasury note falling to 4.21 percent from 4.22 percent late Monday. The U.S. dollar was up against other major currencies in European trading. Gold prices were lower.

Volume was active on the NYSE, with about 1.56 billion shares changing hands, above last year's daily average of 1.46 billion, while on Nasdaq, about 1.70 billion shares traded, below last year's daily average of 1.81 billion.

Advancing stocks outnumbered declining ones by a ratio of more than 2 to 1 on both the NYSE and Nasdaq.

The Russell 2000 index of smaller companies rose 10.30, or 1.56 percent, to 668.86.

Overseas, Japan's Nikkei stock average rose 0.05 percent. In afternoon trading, Britain's FTSE 100 was down 0.24 percent, Germany's DAX index was up 1.08 percent, and France's CAC-40 was up 1.39 percent.

Reuters and the Associated Press contributed to this report.