The Dow Jones industrial average ended up 59.75 points, or 0.5%, to 13,311.72. The broader Standard & Poor's 500 index closed up 7.88 points, 0.6%, to 1,443.69, while the tech-heavy Nasdaq composite index finished up 6.03 points, 0.2%, at 3,050.39.

The yield on the 10-year U.S. Treasury was flat at 1.8%. And the price of gold fell $18.70, 1.1%, to 1,649 an ounce.

Before markets opened, the Intercontinental Exchange said it was buying NYSE Euronext, parent of the New York Stock Exchange. The exchange will stay in New York, it said.

After a week of taking baby steps toward a compromise, President Obama threatened Wednesday to veto a plan floated by the speaker of the Republican-controlled Congress, John Boehner — sparking an early sell-off on global markets. But optimism rebounded later in the day on Wall Street on hints of the talks moving closer to a compromise.

Herbalife (HLF) shares finished 9.8% lower Thursday, down $3.64 to $33.70 apiece after a 12% drop a day earlier. Hedge fund manager William Ackman alleged the nutritional supplements company is a pyramid scheme.

Ackman, founder and CEO of Pershing Square Capital Management, said he has been "shorting" the stock, a bet that the stock will price, for months. He detailed his allegations in a presentation Thursday at the Sohn Conference Foundation meeting in New York.

Ackman told CNBC financial news TV network he expects the Federal Trade Commission to take a "hard look" at the company, which signs up independent distributors to sell supplements, weight loss products and other items in more than 80 countries.

Herbalife Chairman and CEO Michael Johnson said Ackman's accusations are "bogus" and that the timing of his presentation is suspect because Friday is the expiration of a large number of put options, in which investors invest in a contract that will pay off if, in this case, the stock plunges.

In European trading, key stock indexes closed mixed. Britain's FTSE 100 ended the day down 0.05% at 5,959.34, while Germany's DAX 30 index closed up 0.05% to 7,672.10. France's CAC-40 index finished up 0.5% at 3,666.73.

Stocks in Asia also finished mixed. Japan's Nikkei 225 index fell 1.2% to close at 10,039.33, following a strong rally the day before. The Bank of Japan, as expected, announced at the end of a policy meeting that it was expanding its asset-purchase program by about 10 trillion yen ($119 billion) to shore up its flagging economy.

South Korea's Kospi rose 0.3% to 1,999.50, a day after the country elected Park Geun-hye as its first female president. She has pledged to curb the power of family-controlled business conglomerates but has warned against excessive regulations, Yonhap News Agency said.

With less than two weeks to go before the end of the year, markets are "likely to become more nervous by the day," about the U.S. fiscal cliff talks, said Mitul Kotecha of Credit Agricole CIB in Hong Kong.

Still, there is hope that they will reach a deal — at worst, early next year. "The overall trend is of improving risk appetite, so there is an overall belief that there will be a resolution," Kotecha said. "The big issue is how quickly will that come."

Benchmark crude oil prices ended unchanged at $89.98 per barrel in electronic trading on the New York Mercantile Exchange, after an extremely strong session Wednesday on reports of a surprisingly strong decline in inventories. The contract closed Wednesday up $1.58 a barrel, or 1.8%.

In currencies, the euro finished stronger at $1.3243, up 0.3%, against the dollar while the greenback strengthened slightly against the yen to 84.40. up 0.4%.