Stocks closed far above session lows Thursday on news that Greece agreed to a five-year austerity plan, but lingering economic uncertainty ultimately drove indexes mostly lower, keeping the downward trend intact. The Dow industrials and the broader Standard & Poor's 500 rebounded sharply in the last hour of trade, while the Nasdaq finished in solidly positive territory, following reports from Athens that the agreement reached Thursday with the European Union (EU) and the International Monetary Fund (IMF) will allow for a hoped-for resolution to Greece's credit problems, which have hurt investor sentiment around the world. Stocks plunged when the market opened, following a disappointing assessment on the U.S. economy Wednesday by the Federal Reserve. Weak readings on U.S. jobless claims and new-home sales added to investor pessimism. Later, an announcement that the U.S. government plans to tap into the Strategic Petroleum Reserve (SPR) caused oil prices and energy-company stocks to plunge. The International Energy Agency (IEA) said its 28 members would release 60 million barrels of oil, half of which will come from the SPR. Light sweet crude for August delivery plummeted 4.6 percent, falling to a four-month low of $91.02 a barrel on the New York Mercantile Exchange. Gold futures fell $32.90, or 2.1 percent, to $1520.50 an ounce. The U.S. dollar managed modest gains versus the euro and the yen. The Dow Jones industrial average fell 59.67, or 0.5 percent, to 12,050.00. Chevron and Exxon Mobil led the index's declines for much of the day. The S&P 500 index fell 3.64, or 0.3 percent, to 1,283.50. The technology-heavy Nasdaq composite index rose 17.56, or 0.7 percent, to 2,686.75.