All three major U.S. stock indexes closed higher and long-dated Treasury yields rose on news of two opposing sides in Washington nearing agreement on a new fiscal aid package.

"There's a lot of volatility in the market," said Peter Tuz, president of Chase Investment Counsel in Charlottesville, Virginia. "If Mnuchin and Pelosi come out this evening and say 'we're not talking any more' and the market will sell off."

Amid talks with Treasury Secretary Steven Mnuchin, House of Representatives Speaker Nancy Pelosi, a Democrat, said negotiations were progressing and that legislation could be hammered out "pretty soon."

While a White House spokesman added a further note of optimism, saying "this is really the most optimistic we've felt about getting a deal," President Donald Trump's economic adviser Larry Kudlow said "significant policy differences" remain.

"There are some positive signs that maybe we'll get stimulus reasonably soon," Tuz added. "I think we'll see some kind of deal between now and sometime next week."

The United States was on the brink of a widespread coronavirus outbreak, with nearly two-thirds of states in a danger zone and six, including election battleground Wisconsin, reported a record one-day increase in COVID-19 deaths on Wednesday.

U.S. economic data surprised to the upside, as jobless claims fell more than expected and existing home sales blew past estimates to more than a 14-year high.

The Dow Jones Industrial Average rose 152.84 points, or 0.54%, to 28,363.66, the S&P 500 gained 17.93 points, or 0.52%, to 3,453.49 and the Nasdaq Composite added 21.31 points, or 0.19%, to 11,506.01.

European stocks seesawed through much of the day but closed in the red for the fourth straight day.

Still, they settled well off session lows, trimming losses after Britain's Finance Minister announced billions of pounds in pandemic relief for hard-hit businesses.

Coronavirus cases on the continent surged to a record high, with Spain becoming the first Western European country to exceed a million infections and France, Britain and Italy all experiencing recent record increases.

The pan-European STOXX 600 index lost 0.14% and MSCI's gauge of stocks across the globe gained 0.07%.

Emerging market stocks lost 0.21%. MSCI's broadest index of Asia-Pacific shares outside Japan closed 0.31% lower, while Japan's Nikkei lost 0.70%.

Long-dated Treasury yields hit four-month highs and the yield curve steepened on news of progressing pandemic relief talks. Benchmark 10-year yields hit their highest since early June.

Benchmark 10-year notes last fell 14/32 in price to yield 0.863%, from 0.816% late on Wednesday.

The 30-year bond last fell 35/32 in price to yield 1.677%, versus 1.629% late on Wednesday.

Crude prices recovered some of the ground lost in the previous session when higher U.S. gasoline inventories signaled deteriorating demand.

U.S. crude rose 1.52% to settle at $40.64 per barrel, while Brent gained 1.75% to settle at $42.46 per barrel.

Ongoing uncertainties surrounding the timing and size of a U.S. pandemic aid package helped the dollar edge up from a seven-week low against a basket of world currencies.

The dollar index rose 0.36%, with the euro down 0.37% to $1.1817.

The Japanese yen weakened 0.30% versus the greenback at 104.92 per dollar, while sterling was last trading at $1.3074, down 0.53% on the day.

Gold dipped as better-than-expected U.S. economic data and a strengthening dollar dampened the safe-haven metal's appeal.

Spot gold dropped 1.0% to $1,904.73 an ounce.

(Reporting by Stephen Culp; additional reporting by Matthew Scuffham, Karen Brettell and Richard Chang; Editing by Will Dunham)

By Stephen Culp