A broad rally on Wall Street Thursday added to the market's solid gains this week and pushed the S&P 500 and Nasdaq composite to all-time highs.

Strong company earnings and optimism that Washington can reach a deal for another round of fiscal stimulus for millions of Americans who need it has kept investors in a buying mood this week. The S&P 500 rose 1.1%, eclipsing the benchmark index's last record high set early last week. The three major stock indexes are on track for weekly gains above 3%, an encouraging start to February after a late fade in January.

Financial and technology companies lead the way higher. Small-company stocks also had a strong showing, another bullish signal that investors are feeling more optimistic about the economy.

“The path of least resistance seems to be higher,” said Brian Price, head of investment management for Commonwealth Financial Network. “We had a few minor pullbacks since the start of the year, but it really seems an extension of what we saw in the fourth quarter where it seems the market is anticipating lockdowns ending, people going back to work and economies broadly opening.”

The S&P 500 index rose 41.57 points to 3,871.74. It was the index's fourth-straight gain. The Dow Jones industrial average picked up 332.26 points, or 1.1%, to 31,055.86. The technology-heavy Nasdaq gained 167.20 points, or 1.2%, to 13,777.74, also an all-time high. The Russell 2000 index of smaller company stocks climbed 42.72 points, or 2%, to 2,202.42.

Volatility spiked last month amid worries about the timing and scope of another round of stimulus spending by the Biden administration and unease over the effectiveness of the government’s coronavirus vaccine distribution. A wave of selling left the S&P 500 down 3.3% for the week.

Stocks have shaken off those concerns. So far this week, the S&P 500 is up 4.2%, more than making up for its pullback last week.

“There are a lot of reasons to be optimistic and, obviously, there’s a tremendous amount of stimulus in the system with talks of more,” Price said.

Wall Street continues to be focused on individual company earnings. Shares of eBay rose 5.3% and PayPal climbed 7.4% after both companies reported results that blew away Wall Street's expectations.

“We’re really impressed with how corporate America has come through earnings season so far,” said Jeff Buchbinder, equity strategist at LPL Financial.

The performance so far is a surprising and welcome about-face from early projections for weak profits. Tech companies are doing particularly well, but financial and smaller companies are also releasing surprisingly good results, he said.

Analysts were expecting an earnings contraction of about 13% heading into the latest round of quarterly reports, according to FactSet. With about half of companies reporting, the S&P 500 is now showing earnings growth of just under 1% and estimates for both the next quarter and all of 2021 are improving.

Shares of the beaten-down companies that have been of intense interest by retail investors fell again. GameStop slid 42.1%, continuing is sharp pace downward following its meteoric rise over the previous two weeks. At $53.50 a share, it's still well above the $17 price it fetched at the beginning of the year. It traded as high as $483 last Thursday. AMC Entertainment dropped 21%.

In Washington, President Joe Biden urged Democrats lawmakers to “act fast” on his economic stimulus plan but also said he’s open to changes. Democrats and Republicans remain far apart on support for President Joe Biden’s $1.9 trillion stimulus package, but investors are betting that the administration will opt for a reconciliation process to get the legislation through Congress.

In economic data, the number of Americans who filed for unemployment benefits fell below 800,000 last week, which was better than economist expectations but still remains high due to the pandemic. The Labor Department is due to report its jobs data for January on Friday. Wall Street is expecting the closely watched report will show the U.S. economy added 100,000 jobs last month. That would follow a loss of 140,000 jobs in December.

Meanwhile, vaccine distribution continues to move ahead and Wall Street expects an eventual fiscal aid package from Washington to give the economy another jolt.

“Each passing day with a million plus shots going into people arms gets us closer to full reopening,” Buchbinder said. “This economy, we think, will really be rolling in the next couple of months.”

Copyright 2021 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.