In this photo provided by the New York Stock Exchange, a board above a trading post on the floor, shows the symbol for Northern Star Acquisition Corp., Thursday, Dec. 17, 2020. Credit: Colin Ziemer / New York Stock Exchange via AP

Stocks gave up an early gain and closed modestly lower on Wall Street, giving the S&P 500 its first loss in four days. The 0.2 percent fall Tuesday came a day after major indexes had notched their latest all-time highs. The market had started the day higher after President Donald Trump signed into law the $900 billion coronavirus economic relief package.

Small-company stocks fell more than the rest of the market. Even with its 1.8 percent loss Tuesday, the Russell 2000 index of smaller companies is still on track for a gain of 7.7 percent this month, more than twice that of the S&P 500.

The S&P 500’s slip placed the benchmark index on track for its first decline in four days.

Investors shifted money away from technology companies, which have been among some of the biggest winners since the pandemic began. Industrial and financial stocks also fell broadly.

Those losses outweighed gains in health care stocks and companies that rely on consumer spending. Treasury yields were mostly higher, though, a sign of confidence in the economy.

The market’s pullback follows a strong, record-shattering run on Wall Street in recent weeks amid optimism that coronavirus vaccinations will pave the way in coming months for the economy to escape from the pandemic’s grip.

The Dow Jones Industrial Average fell 72 points, or 0.2 percent, to 30,333 as of 3:02 p.m. Eastern. The tech-heavy Nasdaq was down 0.4 percent. Smaller company stocks were taking some of the biggest losses, sending the Russell 2000 index 2.3 percent lower. The index is still on track to end the month 7 percent higher.

Wall Street set fresh records on Monday after President Donald Trump signed a wide-ranging spending bill that includes $900 billion in COVID-19 aid and reams of other legislation on taxes, energy, education and health care. Investors hope that the measures will help tide the economy over until more people get vaccinations and help it through its pandemic-induced slump.

“We’re kind of seeing the same thing we’ve been seeing, the dichotomy between where the financial markets are and where the actual economy is,” said Charlie Ripley, senior investment strategist for Allianz Investment Management.

The recent round of aid from Washington was mostly expected and it would have taken a much bigger package to really make markets jump, he said.

The only other pending set of business from Washington is whether Senate Republicans will pass President Trump’s push to get $2,000 stimulus checks to Americans instead of the current $600. Senate Majority Leader Mitch McConnell on Tuesday blocked Democrats’ push to immediately bring President Donald Trump’s demand for bigger $2,000 COVID-19 relief checks up for a vote, saying the chamber would “begin a process” to address the issue.

The yield on the 10-year Treasury rose to 0.93 percent from 0.92 percent late Monday.

Trading has been thin as a tumultuous 2020 draws to a close. The market will be closed for New Year’s Day Friday.

European markets mostly rose. The French CAC 40 rose 0.4 percent, while the FTSE 100 was up 1.5 percent. The German DAX fell 0.2 percent.

In Tokyo, the Nikkei 225 jumped 2.7 percent to 27,568.15, the first time it has traded above 27,000 since August 1990, according to FactSet. The market hit its all-time peak close of 38,915.87 on Dec. 29, 1989.

Story by Damian J. Troise and Alex Veiga.