U.S. stocks fell on Tuesday, with the S&P 500 falling 2 percent by midday, putting the index on track for its worst day since May.

The trigger for Tuesday’s sell-off was a rise in the yield on the benchmark 10-year Treasury note. Investors, weighing the prospect of the Federal Reserve preparing to reduce its purchases of government debt, sold off bonds, pushing the 10-year’s yield up to 1.53 percent, its highest level since June.

Government bond yields are the basis for borrowing costs across the economy, and a rise can hinder the stock market’s performance because it makes owning bonds more attractive and can discourage riskier investments.

Tech stocks are particularly sensitive to the prospect of higher interest rates, and those companies’ shares were hard-hit on Tuesday. The tech-heavy Nasdaq composite was down 2.7 percent at midday.

Higher rates can also make borrowing more expensive for companies, in particular smaller ones, and the jump in yields hit shares of several high-flying stocks hard. Etsy, the online craft marketplace, was off as much as 7.5 percent, and Shopify was off 5.4 percent. Both companies have soared during the pandemic and were still up more than 20 percent for the year.

“With tech stocks, you’re betting for a company to have a breakthrough years from now,” said Beth Ann Bovino, the chief U.S. economist at S&P Global. “If interest rates go up today, that value that you receive years from now is discounted.”

The vast pull the big tech companies have — particularly Amazon, Apple, Microsoft, Google and Facebook — also helped drag down the S&P 500. Apple was down 2.3 percent and was the best performer of the tech giants. Amazon, Microsoft, Facebook and Google were down by more than 3 percent.

It helped a little that energy stocks rallied after oil prices climbed early in the day. Schlumberger, Baker Hughes and Marathon Oil were among the best-performing shares in the S&P 500, though their gains faded as oil futures turned lower later in the day.

The trading echoes the volatility of earlier this year, when a jump in rates roiled financial markets. That rise happened as traders worried that higher inflation might cause the Fed to increase rates sooner than they had forecast.

“There’s no doubt that the equity market does not like higher rates — there’s just no debate about it,” Ralph Axel, director of U.S. Rates Strategy at Bank of America.

Investors were also concerned as Treasury Secretary Janet L. Yellen warned lawmakers on Tuesday of “catastrophic” consequences if Congress does not deal with the debt limit before Oct. 18. Ms. Yellen suggested that a default would jeopardize the dollar’s status as the international reserve currency.

Lauren Goodwin, an economist at New York Life Investments, wrote in a note to investors that risks like that “should do little to impact the broader fundamental environment.”

She said the forces affecting investor confidence would instead remain those that have been most at play throughout the past 18 months.

“The path will depend heavily on our three highly uncertain drivers — the pandemic, monetary policy and fiscal policy,” she wrote.

The central bank has signaled that it will begin to slow its massive bond purchase program as soon as November. That policy has been keeping money flowing through financial markets, but officials have decided that it is less necessary as the economy rebounds.

The Fed’s main policy interest rate — its more powerful and traditional tool — remains near zero. Mr. Powell and his colleagues have signaled that the Fed is months or years away from raising interest rates, because it wants to see the job market return to full strength before doing so.

“The test for raising interest rates is substantially higher,” Mr. Powell reiterated at a Senate Banking Committee hearing on Tuesday. “We want to see” a “labor market that is very strong, we want to see the kind of reductions in disparities — the kind of thing that we did see before the pandemic arrived.”

The S&P 500 is on track to drop 3 percent in September, ending seven straight months of gains.

Jeanna Smialek contributed reporting.