The Dow Jones Industrial Average moved higher on Tuesday, registering its largest daily percentage gain in more than a month, as stronger-than-expected results and forecasts from companies including 3M and Caterpillar fueled optimism about economic strength. Meanwhile both the S&P 500 and Nasdaq indexes ended the trading day in positive territory by a small margin.

3M closed about 5.9 percent higher and Caterpillar was up 5 percent, giving the Dow its largest supplemental gain, after the companies reported quarterly results and gave upbeat outlooks. The S&P industrial sector index ended the day with a gain of 0.5 percent, also a record intraday high.

Stocks trimmed gains late in the day after Bloomberg reported Stanford University economist John Taylor may have won in a show of hands by Senate Republicans when asked by President Donald Trump about their support of potential nominees for Federal Reserve chair.

Also dampening the market’s mood late in the session, Republican Sen. Jeff Flake criticized Trump’s style of governing and announced he would not run for re-election next year, highlighting tensions between the president and fellow Republicans.

Upbeat results also came from General Motors, which rose 3 percent. The automaker reported stronger-than-expected earnings, reaffirmed its full-year earnings forecast and promised to slash stocks of unsold vehicles.

McDonald’s also rose following results. The stock ended the trading day up 0.3 percent.

Meanwhile, the financial index, up 0.7 percent, gave the S&P 500 its largest improvement. Strong earnings and optimism about Trump’s tax plans have sent stocks upward in recent sessions.

Offsetting some of the day’s gains, Biogen slipped 3.9 percent after reporting disappointing sales of a potential blockbuster drug, Spinraza.

Whirlpool fell 10.5 percent after the home appliances maker reported profit and sales below estimates and lowered full-year earnings guidance.

Approximately 6.2 billion shares changed hands on the major domestic equity exchanges, a number that compared favorably to the 5.9 billion share daily average for the past 20 trading days, according to Thomson Reuters data.