Stocks posted a third day of modest gains on Thursday after Greece reached a deal to secure a financial bailout, but investors were cautious after weeks of gains.

Based on the latest available data, the Dow Jones industrial average <.DJI> was up 8.25 points, or 0.06 percent, at 12,892.20. The Standard & Poor's 500 Index <.SPX> was up 2.07 points, or 0.15 percent, at 1,352.03. The Nasdaq Composite Index <.IXIC> was up 11.41 points, or 0.39 percent, at 2,927.27.

(Reporting By Caroline Valetkevitch; Editing by Kenneth Barry)