NEW YORK (AP) — Treasury yields surged in September and sapped the energy from a strong stock market as investors came to terms with the likelihood that interest rates will remain high well into 2024.

The yield on the 10-year Treasury, which influences rates for mortgages and other loans, jumped past 4.50% in September and continues rising. It is at its highest level in nearly two decades. The yield on the 2-year Treasury, which tracks expectations for the Fed’s interest rate policy, jumped above 5.00% in September and also continues edging higher.

“Once again, the move in rates has proven to be too much too fast for equity markets to handle,” said Adam Turnquist, chief technical strategist at LPL Financial, in a note to investors.

High bond yields make it less likely that investors will invest in riskier stocks, especially pricey technology companies. The early autumn slump in bond prices that jolted yields higher tripped up what had been a solid recovery for the S&P 500 and other major indexes in 2023. That could remain the case for the rest of the year and into 2024.

The S&P 500 surged more than 17% through July, slipped in August, and then gave back 5% in September when the Fed signaled that rates will likely remain high well into 2024.

“Market participants seem to be coming to peace, finally, with the ‘higher for longer’ forecast,” said Katie Nixon, chief investment officer for Northern Trust Wealth Management, in a note to investors.

The Federal Reserve’s benchmark interest rate is at its highest level in more than 20 years and the central bank could be close to pausing its aggressive rate hike policy meant to tame inflation. But, it likely won’t cut rates anytime soon, leaving pressure from high interest rates squeezing the broader economy.

Treasury yields last hovered at these levels in mid-2007 and the broader market ranged from ticking higher to holding steady. That held until the financial crisis of 2008 wreaked havoc on the markets and economy, eventually prompting the Fed to slash its benchmark interest rate to near zero.

High bond yields aren’t just deterring investors. High interest rates make borrowing more expensive for companies. It also puts more pressure on companies with lots of interest expenses on their balance sheets. Those issues, along with inflation, have been weighing on corporate earnings, especially those of smaller companies that need to borrow more for operations.

Wall Street expects companies in the S&P Small Cap 600 to report a 14% slump in third-quarter profits to follow up on a 20% slump in the second quarter. That compares with expectations for stagnant profits in the broader S&P 500 after a 4% drop in the previous quarter.

High interest rates will also likely put pressure on technology stocks that have high price-to-earnings ratios. Insurance companies can benefit from higher rates because their bond investments get better returns.

Those higher interest rates, though, will likely squeeze consumers as they deal with more expensive loans, especially mortgages, which are at their highest in more than two decades. High rates have worsened an affordability crunch with home prices near all-time highs even as home sales fall.