Earlier, the S&P and Dow struggled to hold opening gains before climbing as oil prices extended gains.
U.S. crude oil futures settled up $1.86, or 5.2 percent, at $37.75 a barrel after weekly crude inventories from the EIA showed a draw of 4.9 million barrels.
The U.S. dollar index touched its lowest since Oct. 2015 before recovering slightly, with the euro near $1.14 and the yen at 109.7 yen against the greenback. Earlier, after the Fed minutes' release, the yen hit 109.4, a fresh high against the dollar since Oct. 2014.
We'll "see how Japanese equities react tonight. If (the dollar/yen) keeps sliding then there's going to be some problem," Klein said.
Overnight, the Nikkei 225 fell 0.11 percent for its first seven-day losing streak since November 2012.
The Federal Open Market Committee minutes from the March 15 to 16 meeting were released at 2 p.m. ET. At that meeting, the central bank kept rates unchanged and lowered its projections for the number of hikes this year to two from four.
Treasury yields recovered from Tuesday's decline to hold slightly higher. The 2-year yield was near 0.74 percent and the 10-year yield at 1.75 percent.
"I'm a little surprised we didn't give back a little bit of it from the Fed minutes, which I though emphasized a little more the risks from abroad more than we had heard from the Fed previously," said Sharon Stark, managing director and fixed income strategist at D.A. Davidson.
St. Louis Fed President James Bullard said the Fed could raise rates at any meeting, or even between meetings, according to a Bloomberg Radio interview cited by Reuters. However, he noted the pieces of data since the Fed's March meeting have been "mixed," making it potentially difficult for the Fed to raise rates this month.
Ahead of the Fed minutes release, Cleveland Fed President Loretta Mester said she expects a gradual series of interest rate hikes this year given recent U.S. economic strength.
"It will be appropriate to continue to gradually reduce the degree of accommodation this year," she told the Cleveland Association for Business Economics.
Read MoreThis could be a historic moment in the Treasury market
European stocks ended more than half a percent higher.
In Asia, the major averages were narrowly mixed. The Shanghai composite also ended mildly lower while the Hang Seng gained slightly.
The Caixin/Markit services PMI for March rose to 52.2 from February's 51.2, but the employment sub-component fell to 48.9 from 51.3, pointing to the first contraction in staffing levels since August 2013.
In corporate news, Pfizer abandoned its merger with Allergan following the Treasury's fresh moves to limit inversions. Allergan closed up nearly 3.5 percent, while Pfizer jumped 5 percent.
Read MoreAllergan CEO: Merger with Pfizer was targeted by US government
Separately, the U.S. Department of Justice filed a suit to block the merger of Halliburton and Baker Hughes. The two firms said in a press release they "intend to vigorously contest" the DOJ. Shares of Halliburton closed up 5.9 percent and Baker Hughes ended 8.8 percent higher.
U.S. stocks closed lower Tuesday, following declines in overseas developed markets on soft data, despite gains in oil prices and better U.S. data.
"Yesterday's 1.0 percent decline in the SPX reflects a loss of short-term momentum that was already evident in most global equity markets," BTIG Chief Technical Strategist Katie Stockton said in a morning note. "We find it worrisome that the NASDAQ 100 Index gapped down for the first time since early January."
Read More Early movers: STZ, PFE, AGN, WFC, CSCO, PLCM, AMZN, JNJ, CREE & more
The Dow Jones industrial average closed up 112.73 points, or 0.64 percent, at 17,716.05, with Pfizer leading advancers and General Electric the greatest decliner.
The Dow transports underperformed, closing down 0.24 percent with Matson leading decliners and UPS the top advancer.
The S&P 500 gained 21.49 points, or 1.05 percent, to 2,066.66, with health care the top advancer and utilities lagging.
The Nasdaq composite gained 76.78 points, or 1.59 percent, to 4,920.72.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, fell 8.6 percent to 14.09.
About three stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of 854 million and a composite volume of nearly 3.7 billion.
Gold futures for June delivery settled down $5.80 at $1,223.80 an ounce.
—Reuters contributed to this report.
On tap this week:
Earnings: Bed Bath & Beyond
6:30 p.m. St. Louis Fed President James Bullard
8 p.m. Dallas Fed President Rob Kaplan
Earnings: CarMax, Rite Aid, Ruby Tuesday, Duluth, WD-40
8:30 a.m. Jobless claims
10:30 a.m.: Natural gas inventories
3 p.m. Consumer credit
5:30 p.m. Fed Chair Yellen with former chairmen Bernanke, Greenspan, Volcker on a panel hosted by International House
8:15 p.m. Kansas City Fed President Esther George
10 a.m. Wholesale trade
1 p.m.: Oil rig count
*Planner subject to change.
More From CNBC.com:
—Reuters contributed to this report.