"You're going to see more of these gyrations as investors continue to weigh the Fed move," said Katie Nixon, chief investment officer at Northern Trust Wealth Management.
Overnight, St. Louis Fed President James Bullard told CNBC that a summer rate hike isn't set in stone, but the labor data is "probably the strongest argument for going ahead."
European stocks again set a positive tone for U.S. stocks, with the German DAX closing 1.5 percent higher. Euro zone finance ministers said they gave Greece a "breakthrough" debt relief deal that won provisional commitment from the International Monetary Fund.
"Yesterday the supposed catalyst was the poll in the U.K. ... Today the talk and chatter is the world economy and the world markets are pricing in and becoming comfortable with a rise in rates, either in June or July," said Peter Coleman, head trader at Convergex. "My personal opinion is it's a trading move because it's a very light volume week with not a lot of news out."
"(You've) got a lot of professional traders pushing the markets up here for a short-term trade," he said.
The Dow Jones industrial average closed about 145 points higher after earlier adding 185 points. Goldman Sachs and IBM contributed the most to gains.
Lance Roberts, chief investment strategist at Clarity Financial, said the technical backdrop for stocks has improved, but "we really need to see some follow-through by the end of the week."
U.S. crude oil futures settled up 94 cents at $49.56 a barrel, its highest since October. Weekly crude inventories from the EIA showed a drawdown of 4.23 million barrels, following the American Petroleum Institute's report of a 5.1 million barrel decline. WTI last traded above $50 a barrel in mid-October.
"At the margin if you can get a few bits of good news you can get people to stop abandoning stocks," said Bruce McCain, chief investment strategist at Key Private Bank.
In economic news, the Markit Flash U.S. services PMI for May was 51.2, down from 52.8 in April and well below the long-run survey average of 55.6, Markit said.
Treasury yields were little changed, with the 2-year yield near 0.90 percent and the 10-year yield around 1.87 percent. Earlier, the 2-year yield touch 0.938 percent, its highest since mid-March.
The Treasury auctioned $34 billion in 5-year notes at a high yield of 1.395 percent.
The U.S. dollar index was mildly lower, with the euro near $1.115 and the yen near 110.2 yen against the greenback. Pound sterling hit $1.4728, its highest level since May 3.
Oil's gains and indications of a decreasing probability of the U.K. leaving the European Union were "what drove the sentiment change between yesterday and today," said Andres Jaime, global FX and rates strategist at Barclays.