Stocks added to gains by late afternoon Wednesday after the Federal Reserve's minutes from its June meeting confirmed members' prudent approach to monetary policy-making.

The S&P 500 was up 0.45%, the Dow Jones Industrial Average added 0.4%, and the Nasdaq moved 0.67% 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.

"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. 

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.

Crude oil hit a two-month low earlier Wednesday 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.

Oil prices reversed course by midday. West Texas Intermediate crude oil closed 1.8% higher at $47.43 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.

Gold prices were on a tear on Wednesday morning as investors sought safe-haven assets amid the uncertainty of the Brexit situation. Prices hit their highest in 28 months with spot gold trading around $1,371.40 an ounce.

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.

Walgreens Boots Alliance (WBA - Get Report) topped third-quarter estimates and bumped up the low-end of its full-year earnings forecast. The convenience and drugstore chain earned an adjusted $1.18 a share in the quarter, 4 cents above estimates. The company anticipates full-year earnings of at least $4.45 a share, a dime higher than its previous low-end target. Its acquisition of Rite Aid is expected to close in the second half of the year.

"Walgreens Boots Alliance delivered a solid beat and raise," said Jim Cramer, portfolio manager, and Jack Mohr, director of research at Action Alerts PLUS, which holds Walgreens. "We view the results as solid yet neutral."

United Continental (UAL - Get Report) was downgraded to neutral from outperform at Credit Suisse. The firm said consensus estimates appear too high given higher industry fuel costs. American Airlines (AAL) was also downgraded at Credit Suisse to underperform from outperform. Analysts said industry unit revenue growth will likely continue to disappoint.

Netflix (NFLX - Get Report) was downgraded to underperform from hold with an $80 price target, according to Jefferies. A new analyst covering the company expects flatter U.S. subscriber growth.