By Michael Wursthorn and Joe Wallace

U.S. stocks ended a wild session not far from where they started, thanks to a bounceback in shares of technology companies.

The broad S&P 500 index ended up eking out a 0.1% gain to snap a five-session losing streak after falling as much as 1.8% earlier in the session. Federal Reserve Chairman Jerome Powell kicked off the turnaround by tamping down inflation worries that had reared from a recent rise in bond yields.

"The economy is a long way from our employment and inflation goals," Mr. Powell said at a hearing of the Senate Banking Committee Tuesday morning, adding that a substantial recovery "is likely to take some time."

A sharp rise in yields on U.S. government bonds in recent days has sapped investors' appetite for riskier assets, including stocks. Shares in technology companies, which have powered the broader market higher for much of the past year, are seen as particularly vulnerable, thanks to high valuations. Their profits become less valuable in today's terms when investors apply a higher discount rate, thanks to rising 10-year Treasury yields.

Those concerns weighed heavily on investors on Tuesday morning.

Before Mr. Powell's comments, the tech-heavy Nasdaq Composite Index dropped as much as 4% and investor favorites including Tesla and Moderna logged double-digit losses. After Mr. Powell started talking, shares of technology companies recouped most of their losses, helping to alleviate pressure on the Dow industrials, which also closed higher. The blue-chip index added 15.66 points, or less than 0.1%, to 31537.35.

The Nasdaq remained stuck in the red, closing down 67.85 points, or 0.5%, to 13465.20. The tech-heavy index has fallen five of the past six trading sessions, leaving it off 4.5% from its Feb. 12 high.

The rise in bond yields "naturally does cause investors and cause markets to re-examine the view on equities," said Paul Jackson, global head of asset allocation research at Invesco. Investing in government bonds is beginning to look more attractive for the first time in months, he said.

But "the level at which bond yields become truly problematic for equities is a long way from where we are now," Mr. Jackson added.

Some investors say they are already re-evaluating their portfolios, though. Most of those moves involve pulling some money out of growth stocks and putting some of those gains into reopening stocks and other companies more tied to the economy.

Tuesday's favorites included casinos Wynn Resorts and MGM Resorts International, which were up $9.73, or 7.7%, to $136.48 and $2.07, or 5.5%, to $39.59, respectively, and Walt Disney, up $5.33, or 2.8%, to $197.09. Airlines, including Southwest Airlines and Alaska Air Group, also traded higher.

"We've been emphasizing more the broader economy and getting exposure to midsized companies," said Tom Hainlin, national investment strategist at U.S. Bank Wealth Management. The move in yields has also revived interest in pockets of the fixed-income market, Mr. Hainlin added, specifically nonagency mortgage backed securities and corporate debt.

Bond yields, which move opposite of prices, also eased following Mr. Powell's comments, helping to take some heat off the stock market. The yield on the 10-year U.S. Treasury note was at 1.363% from as much as 1.381% earlier in the day. Yields remain below pre-pandemic highs, but investors say it is the speed at which yields have increased, rather than their level, that is hurting stocks.

"At the moment, none of those indicators are flashing red -- they are not even amber yet -- but they are not as green as they were six months ago," Remi Olu-Pitan, multiasset fund manager at Schroders, said, referring to the level of yields and expectations of when the Fed is likely to raise interest rates.

Tesla fell $15.66, or 2.2%, to $698.84 after declining almost 9% on Monday. The move came as the price of bitcoin tumbled.

The latest bout of volatility in cryptocurrency markets followed comments by Tesla Chief Executive Elon Musk, who said over the weekend that prices for bitcoin and ethereum seemed high. The electric-vehicle maker earlier this month disclosed that it had bought $1.5 billion in bitcoin. Mr. Musk has also become a prominent cheerleader for cryptocurrencies.

Shares of technology firms and other stocks that have performed well during the pandemic came under pressure. Palantir Technologies extended its recent slide, losing $1.25, or 4.5%, to $26.75. Payments firm Square fell $11.49, or 4.3%, to $256.59.

Home Depot said growth could slow this year, pulling shares down $8.61, or 3.1%, to $267.24.

Other corners of the stock market considered overheated also swooned.

Shares of blank-check companies broadly fell, with an ETF dedicated to the trend, the Defiance Next Gen SPAC Derived ETF, shedding nearly 7%. Reddit-darlings including GameStop and Magnite fell $1.03, or 2.2%, to $44.97 and $6.52, or 11%, to $52.72, respectfully.

Overseas, the Stoxx Europe 600 shed 0.4%, led lower by tech stocks. In Asia, Hong Kong's Hang Seng climbed 1% and China's Shanghai Composite Index slipped 0.2%.

Write to Michael Wursthorn at Michael.Wursthorn@wsj.com and Joe Wallace at Joe.Wallace@wsj.com

Corrections & Amplifications

This item was corrected on Freb. 24, 2021 to show that Remi Olu-Pitan, multiasset fund manager at Schroders, said that "at the moment, none of those indicators are flashing red -- they are not even amber yet -- but they are not as green as they were six months ago." An earlier version incorrectly omitted her name from the attribution.

(END) Dow Jones Newswires

02-23-21 1732ET