Stocks snapped a three-day losing streak, but came off the day's highs Wednesday after a top Fed official said he is against providing stimulus even if the economy worsens, opposing previous comments from chairman Ben Bernanke that fueled a strong rally for most of the session.
The Dow Jones Industrial Average closed higher, led by Caterpillar.
The S&P 500 and the tech-heavy Nasdaq also finished higher. The CBOE Volatility Index, widely considered the best gauge of fear in the market, fell near 19.
Most S&P sectors were higher, led by consumer discretionary, materials and energy.
Dallas Fed President Richard Fisher said he "will not support further monetary accomodation," even if the economy worsens.
"I do not personally see the benefit of more monetary accommodation even if the economy weakens further," Fisher told reporters after a speech at the Rotary Club of Dallas. Because again, there's so much liquidity out there, what's the trigger to put it to work?"
Fisher is a voter this year on the Fed's policy-setting panel.
Stocks soared earlier after Bernanke said the Fed is preparing for another round of Treasury bond buying in a speech to Congress, also known as quantitative easing. He also said it could also cut the interest paid to banks on the reserves they hold as a way to encourage them to lend more.
“The only thing the Federal Reserve can control is the equity market,” said to Alan Valdes, director of floor operations at DME Securities. “It’s going to help the equity markets short-term because people are keeping this market from double-dipping…but it doesn’t help the economy at all.”
In addition, Bernanke said the Fed could also be more explicit in spelling out how long it planned to keep rates at record-low levels. That would give investors confidence about the Fed's efforts to continue supporting the economy.
Traders also monitored actions from Washington as they became more sensitive to comments regarding the debt ceiling and deficit discussions. The nation could go into default if the debt ceiling isn't raised by Aug. 2.
House Speaker John Boehner said he hasn't been able to get commitments from Obama and his team about cutting big entitlement programs, adding that "dealing with them the last couple months has been like dealing with Jell-O."
Minutes to the central bank's June meeting on Tuesday suggested while some members were pondering the possible need for additional easing amid a weak economy, the Fed is not yet ready to take any further action.
The dollar declined against most major currencies.
On the tech front, Apple gained after Citigroup raises its price target on the iPhone maker to $450 from $435. Meanwhile, China Telecom said it plans to offer the iPhone in China by year-end, the second operator to do so in the world's largest cell phone market.
Netflix hiked monthly pricesfor customers who use both its mail and online services, a move that could steer users toward its growing streaming service.
ITG plunged after the financial technology firm said it plans to reduce costs by cutting jobs and reducing infrastructure to deal with weak institutional equity trading volumes.
Meanwhile, Electronic Arts , the video game publisher, is buying PopCap Gamesin a deal worth up to $1.3 billionas it tries to ramp up its social and casual games portfolio and better compete with Zynga according to a report from Reuters.
Meanwhile, NewCorp jumped after the media giant announced it is withdrawing its $12 billion bidfor BSkyB, but plans to remain as a long-term shareholder.
Among earnings, Capital One slipped even after the credit-card provider posted larger-than-expected quarterly profit and said it would raise $2 billion via stock offering to fund the acquisition of ING's
Yum and Marriott are scheduled to release reports after-the-bell.
Gold prices climbed for an eighth-consecutive session, hitting a record high above $1,580 an ounce, amid concerns over the ongoing euro zone crisis that prompted investors to flock to the precious metal as a safe-haven trade.
Oil prices rallied after a government report showed crude inventories fell more than expected. U.S. light, sweet crude gained above $98 a barrel, while London Brent crude traded above $118.
Oil-services firms advanced including Nabors Industries and Baker Hughes.
Clean Energy Fuels soared for a second day after Chesapeake Energy
The government auctioned $21 billion in 10-year notes, which had a high yield of 2.918 percent and a bid-to-cover of 3.17.
On the economic front, U.S. import prices fell for the first time in a yearin June as petroleum and food costs tumbled, according to the Labor Department.
Overall import prices dropped 0.5 percent, after gaining 0.1 percent in May. Economists polled by Reuters had expected prices to drop 0.6 percent last month. Import prices were up 13.6 percent in the 12 months through June.
And weekly mortgage applications fell last week for the fourth time, due to a decline in refinance demand even as interest rates tumbled, according to the Mortgage Bankers Association.
China's economy grew faster than expected in the second quarter as the nation's GDP rose 9.5 percent from a year earlier, exceeding expectations for 9.4 percent, helped by robust domestic consumption and investment.
European shares closed higher after Italian banks recovered some losses from worries over the euro zone debt crisis and following Bernanke's comments. Moody's downgraded Ireland's rating to junk statusTuesdayand said the country is likely to follow Greece in needing a second bailout.
Coming Up This Week:
WEDNESDAY: Earnings from Yum Brands
THURSDAY: PPI, retail sales, jobless claims, business inventories, 30-yr bond auction, money supply, NPD video games sales; Earnings from JPMorgan and Google
FRIDAY: CPI, Empire state mfg survey, industrial production, consumer sentiment, credit card default rates reported, Dell shareholder mtg; Earnings from Citigroup and Mattel
More on CNBC.com