Wall Street rose on Wednesday after the Greek parliament approved austerity measures to avoid defaulting on its debt, but stocks were off their highs on profit taking after hefty gains this week.

Optimism about the plan's approval in Greece has pushed the benchmark S&P 500 to its best three-day performance in three months. The CBOE Volatility Index <.VIX>, Wall Street's fear gauge known as the VIX, fell 8.1 percent to 17.62, its third straight decline.

With the S&P 500 up over 2 percent this week, there were signs of weakness in recent gainers such as technology. The index is also running up against a resistance level near its 50-day moving average at around 1,316.

It's profit taking after a huge move, said Dave Rovelli, a trader at Canaccord Adams in New York. But it's very curious as tomorrow's the last day of the month, and they usually try to dress them up, especially since it's the last day of the quarter.

Financials ranked among the best performers. Bank of America Corp rose 1.9 percent to $11.03 after it reached a settlement with mortgage bond investors. The $8.5 billion settlement removed a question mark hanging over the bank since October. The S&P financial sector index <.GSPF> shot up 1.3 percent.

Lawmakers approved a five-year package of spending cuts, tax increases and state asset sales by a comfortable margin of 155 votes to 138 in a roll-call vote, handing a significant victory to embattled Prime Minister George Papandreou.

The Dow Jones industrial average <.DJI> gained 62.21 points, or 0.51 percent, to 12,250.90. The Standard & Poor's 500 Index <.SPX> rose 7.84 points, or 0.60 percent, to 1,304.51. The Nasdaq Composite Index <.IXIC> added 4.80 points, or 0.18 percent, to 2,734.11.

Commodity-related shares also moved higher as the euro rose and the U.S. Dollar Index <.DXY> fell against a basket of major currencies. Commodities often move inversely to the dollar as they are priced in the U.S. currency on international markets.

The PHLX OIl Service sector index <.OSX> gained 1.5 percent, buoyed by a 3.1 percent gain in Transocean Ltd to $63.64.

Monsanto Co advanced 4.9 percent to $70.17 after its quarterly profit topped estimates, while General Mills Inc rose 1.1 percent to $37.60 after the cereal maker forecast weaker fiscal-year earnings than Wall Street expected.

In other company news, BJ's Wholesale Club Inc added 4.6 percent to $50.30 after it agreed to a buyout by private equity firm Leonard Green & Partners and another group.

Economic data showed U.S. pending home sales rose a stronger-than-expected 8.2 percent in May, but a glut of unsold properties remained a drag on the housing market.

(Reporting by Edward Krudy; Editing by Jan Paschal)