NEW YORK (Reuters) - Wall Street’s three major indexes rallied on Tuesday to clock their biggest one-day gains in five months after Federal Reserve Chair Jerome Powell left the door open for a possible rate cut.

Powell said the central bank would act “as appropriate” to address trade war risks a day after St. Louis Fed chief James Bullard said a rate cut may be warranted soon. Powell said the Fed was “closely monitoring the implications” of a trade dispute that has disrupted global markets.

The last time the benchmark S&P index showed a bigger daily percentage gain was on Jan. 4, when Powell turned more dovish after a late 2018 sell-off, with a promise that the Fed would be patient and flexible in its interest rate path.

Investors have been betting the Fed would cut rates at least once by the end of 2019, according to CME Group’s Fedwatch, and Tuesday’s comments helped to back up these bets.

“Given the fact there’s more than a 95 percent probability of a rate cut baked into fixed income it’s nice to hear the Fed say it will wait for the economy to tell it what to do. If the economy slows due to tariffs, the Fed would consider cutting rates,” said JJ Kinahan, chief market strategist at TD Ameritrade in Chicago.

The Dow Jones Industrial Average rose 512.4 points, or 2.06%, to 25,332.18, the S&P 500 gained 58.82 points, or 2.14%, to 2,803.27 and the Nasdaq Composite added 194.10 points, or 2.65%, to 7,527.12.

The S&P 500 shed more than 6% in May as investors feared a global growth slowdown while trade tensions ramped up between the United States and China and the United States and Mexico.

Slideshow ( 3 images )

“When the market’s been down as much as it has been, all you need is a little bit of a spark,” said Paul Nolte, portfolio manager at Kingsview Asset Management in Chicago.

Nolte said investors also were encouraged after Mexican President Andres Manuel Lopez Obrador said he was optimistic that a deal could be reached even as U.S. President Donald Trump said he was likely to go ahead with new tariffs on all Mexican goods.

A Washington Post report that Republican lawmakers were discussing whether they may have to vote to block President Trump’s planned new tariffs on Mexico also helped sentiment.

Earlier in the day, China’s commerce ministry said the differences and frictions with Washington should be resolved through dialogue.

But Ameritrade’s Kinahan advised taking trade stories “with a grain of salt because it may change tomorrow.”

“We’re going to continue to see tariffs take us back and forth. Particularly now that we’re done with earnings, it’s the main game in town,” he said.

Slideshow ( 3 images )

The tech-heavy Nasdaq’s rebound on Tuesday came after it confirmed a correction on Monday, having lost more than 10% since its record closing high on May 3.

The technology sector was the biggest boost to the S&P with a 3.3% advance, led by gains in Apple Inc and Microsoft.

Rising U.S. Treasury yields boosted the S&P 500 bank index, which jumped 3.65%.

Only the dividend-paying real estate sector ended the day in the red with a 0.6% drop as investors poured their money into riskier bets.

But utilities, typically seen as one of the most defensive bets, edged slightly higher with a 0.04% gain.

Advancing issues outnumbered declining ones on the NYSE by a 4.07-to-1 ratio; on Nasdaq, a 3.18-to-1 ratio favored advancers.

The S&P 500 posted 25 new 52-week highs and 1 new lows; the Nasdaq Composite recorded 44 new highs and 74 new lows.

On U.S. exchanges 7.53 billion shares changed hands compared with the 7.16 billion average in the last 20 sessions.