Stocks are closing higher for the fourth day running on hopes that a vote of confidence in the Greek government will help the country avoid a default.

The S&P 500 index rose 17 points, or 1.3 percent, to close at 1,296.

The Dow Jones industrial average rose 110, or 1 percent, to 12,190. The Nasdaq composite rose 58, or 2.2 percent, to 2,687.

A successful vote of confidence in Greece's government later Tuesday could reassure investors that the country will push through budget cuts required for getting another installment of emergency loans. Worries that a default by Greece could upend financial markets have kept investors on edge since early May.

Six stocks rose for every one that fell on the New York Stock Exchange. Trading volume was 3.6 billion shares.