US stock markets reversed heavy losses on Tuesday, overcoming poor Wall Street results and fresh evidence of a sclerotic housing recovery to finish the day in the black.

"Stocks plunged into the red right out of the gate this morning," said Andrea Kramer of Schaeffer's Investment Research, "however, cooler heads eventually prevailed."

A mad upward dash in the final two hours of trade saw the blue chip Dow Jones Industrial Average finish the day up 75.53 points (0.74 percent) to reach 10,229.96 at the close.

In early trade the index had fallen more than 140 points.

The tech-rich Nasdaq composite index rose 24.26 points (1.10 percent) to 2,222.49 and the broader S&P 500 index rose 12.23 points (1.14 percent) at 1,083.48.

The tone of morning trade was set before the opening bell as the US Commerce Department reported housing starts plunged 5.0 percent in June, declining far more than expected.

Early sentiment was also undermined when Goldman Sachs reported its profits fell 82 percent in the second quarter versus the year before.

The storied investment bank said it would fork out 550 million dollars to settle government fraud charges and 600 million dollars to pay a British tax on executive pay, but investors also fretted that revenues fell 36 percent in the quarter.

Chief executive Lloyd Blankfein said the business environment had become tougher for the embattled firm.

But after an early sell-off the markets began to rebound as investors took another look at Goldman and housing,

"The market looked past a depressed reading of June housing starts, and focused instead on higher-than-expected building permits," said Scott Marcouiller of Wells Fargo.

Building permits, a forward-looking indicator on the housing construction sector, unexpectedly rebounded, by 2.1 percent, after two months running of sharp declines.

Goldman's low price also appeared to coax some bargain hunters back into the market.

"Goldman Sachs was under pressure early, but ended up 2.2 percent at 148.91 as better-than-forecast profits trumped disappointing revenue," said Marcoullier.

Investors had appeared to take little comfort from news that Johnson & Johnson earned 7.5 percent more in the second quarter versus the same period last year, for a profit of 3.45 billion dollars.

But on a weaker outlook its shares slid 1.44 percent for the day.

Meanwhile, PepsiCo reported profits fell three percent to 1.6 billion dollars, but its shares rose just over 4.32 percent amid strong international sales.

United Airlines reported solid earnings, entering into profit for the first quarter in three years. Its shares rose 4.82 percent.

Bond prices were mixed. The yield on the 10-year US Treasury bond fell to 2.948 percent from 2.964 percent on Monday while that on the 30-year bond rose to 3.979 percent from 3.988 percent.