* All three major U.S. stock indexes turn positive

* 10-year Treasury yields highest since early June

* Europe posts fourth day of losses

* Graphic: 2020 asset performance http://tmsnrt.rs/2yaDPgn

* Graphic: World FX rates in 2020 http://tmsnrt.rs/2egbfVh

NEW YORK, Oct 22 (Reuters) - U.S. stocks oscillated for much of the session on Thursday but turned positive by mid-afternoon on optimism about an imminent U.S. fiscal stimulus deal, as global COVID-19 cases surged.

All three major U.S. stock indexes were last solidly green and long-dated Treasury yields rose on news of two opposing sides in Washington nearing a stimulus deal.

"The market's been having a bit of a volatile day, it sold off and battled back," said Tim Ghriskey, chief investment strategist at Inverness Counsel in New York. "The main thing is positive chatter on stimulus. It appears they're close to an agreement."

House Speaker Nancy Pelosi 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 Trump's economic adviser Larry Kudlow warned "significant policy differences" remain.

"This positive (fiscal aid) chatter benefits the overall market and economically sensitive stocks because it means more money in people's hands and more economic activity," Ghriskey added.

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 162.89 points, or 0.58%, to 28,373.71, the S&P 500 gained 17.51 points, or 0.51%, to 3,453.07 and the Nasdaq Composite added 17.83 points, or 0.16%, to 11,502.53.

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 1 million infections and France, Britain and Italy all seeing recent record increases.

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

Emerging market stocks lost 0.20%. MSCI's broadest index of Asia-Pacific shares outside Japan closed 0.29% 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 fiscal aid talks. Benchmark 10-year yields hit their highest since early June.

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

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

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

U.S. crude rose 1.52% to settle at $40.64 per barrel, while Brent, yet to settle, was last up 1.68% at $42.44 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.34%, with the euro down 0.36% to $1.1818.

The Japanese yen weakened 0.27% versus the greenback at 104.89 per dollar, while sterling was last trading at $1.3082, down 0.47% 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.1% to $1,903.99 an ounce.

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