The Federal Reserve doves voiced their concern in June heading into the Brexit vote. Now that the votes are in, the doves will likely stick around. 

The thought pushed stocks to close at session highs with modest gains. The S&P 500 was up 0.53%, the Dow Jones Industrial Average added 0.44%, and the Nasdaq moved 0.75% higher.

The central bank said in June that it would be best to wait for more economic data and the results of the then-upcoming Brexit vote before adjusting monetary policy, according to minutes from last month's meeting. 

"Members generally agreed that, before assessing whether another step in removing monetary accommodation was warranted, it was prudent to wait for additional data on the consequences of the U.K. vote," the minutes read.

Members were also divided on the reasons for the weak May jobs report, though appeared reluctant to change policy based on one report. The U.S. jobs report for June, which will be released on Friday, is forecast to show May's weakness as transitory as Fed members expect.

Fed officials reiterated their criteria which would have to be met before materially changing policy: economic data confirming growth, sufficient and sustained job growth, and inflation heading toward the 2% target over the medium term.

Oil prices reversed course by midday, coming back after hitting a two-month low earlier in the day. Crude had been in decline on fears over how the United Kingdom's exit from the European Union would impact the global economy and demand for the commodity. Worries over the Brexit also pushed the pound to a 31-year low against the U.S. dollar, making foreign purchases of U.S.-produced oil more expensive.

West Texas Intermediate crude oil closed 1.65% higher at $47.37 a barrel on Wednesday.

"The majority of oil's recent slide can be attributed to the broader selloff seen in global markets amid concerns that the post-Brexit vote recovery had proceeded a bit quickly," said Robbie Fraser, commodity analyst at Schneider Electric.

Brexit fears returned in force on Tuesday after the Bank of England attempted to reassure investors that it had enough liquidity to ride out any outcome. Bank of England Gov. Mark Carney said that the central bank has the scope to deal with Article 50, which will kick off Britain's exit, when it is invoked.

"In a post-Brexit world the global outlook has become much more uncertain," Morgan Stanley analysts wrote in a note. "For the U.S., post-Brexit uncertainty hits at a precarious time when job growth is slowing, investment more broadly is in decline, and the Fed is already sitting on ultra-low rates. Financial conditions remain in a state of flux."

Gains in the biotech space boosted the Nasdaq. Celgene (CELG - Get Report) and Vertex Pharmaceuticals (VRTX - Get Report) led markets on general industry M&A talk.

Medivation's (MDVN) board of directors officially rejected a bid from Sanofi (SNY - Get Report) on Tuesday, but did enter a confidentiality pact with the French drugmaker as part of exploring a sale to other bidders. Pfizer reportedly has expressed interest in purchasing the biotech company.

The U.S. services sector continued to expand in June, according to the ISM Non-Manufacturing Index. The measure clocked in at 56.5 in June, remaining above the 50-level separating expansion from contraction. Analysts expected a reading of 53.3.

The U.S. trade gap in May widened on healthy demand for imports such as electronics and home goods. The trade deficit expanded to a three-month high of $41.1 billion in May from $37.4 billion in April. Economists had expected a reading of $42.2 billion.