(CNBC) — U.S. stocks closed higher Tuesday, lifted by gains in oil prices, as investors looked for bargains after the Brexit sell-off.

The major averages extended gains into the close, with the Dow Jones industrial average closing about 269 points higher and the Nasdaq composite up 2.1 percent. The S&P 500 closed nearly 1.8 percent higher.

"I think it was just a market that got a little ahead of itself to the downside," said Robert Pavlik, chief market strategist at Boston Private Wealth.

Read the full story ›