U.S. stocks edged lower Wednesday after Federal Reserve Chairman Jerome Powell acknowledged that the central bank’s rate-raising campaign could cause an economic downturn.

Investors have been watching closely for signs of how the Fed will proceed in its campaign to bring down high inflation by raising interest rates. Central-bank officials last week agreed to raise their benchmark interest rate by 0.75 percentage point, their largest increase since 1994. The S&P 500 notched its worst week since March 2020.

On Wednesday, the broad U.S. stock index fell 4.90 points, or 0.1%, to 3759.89. The Dow Jones Industrial Average slipped 47.12 points, or 0.2%, to 30483.13. The tech-heavy Nasdaq Composite declined 16.22 points, or 0.1%, to 11053.08.

Mr. Powell testified before Congress on Wednesday and is scheduled to testify again on Thursday. He said the central bank plans to continue raising interest rates until it sees clear evidence that inflation is slowing to its 2% target.

An economic downturn is “certainly a possibility,” Mr. Powell said Wednesday during the congressional hearing. “We are not trying to provoke and do not think we will need to provoke a recession, but we do think it’s absolutely essential” to curtail inflation.

Separately, Federal Reserve Bank of Philadelphia President Patrick Harker on Wednesday said the U.S. economy might see a modest contraction in growth, but he expects the job market to remain strong.

Stocks have gyrated in recent weeks as twin fears—soaring inflation and slowing growth—hang over markets. The S&P 500 is on track for its worst first half of a year since 1962, according to Dow Jones Market Data. U.S. stocks rallied Tuesday, offering investors a reprieve from a stretch of whipsaw trading that had sent stocks and cryptocurrencies falling.

Investors sought assets viewed as safer to hold Wednesday, such as U.S. government debt. In bond markets, the yield on the benchmark 10-year U.S. Treasury note declined to 3.155% from 3.304% Tuesday. Yields fall when prices rise. 

“Folks are really reckoning with the fact that probabilities of recession seem to be increasing,” said Gavin Stephens,

director of portfolio management at Goelzer Investment Management.

In energy markets, Brent crude, the international benchmark for oil prices, dropped 2.5% to $111.74 a barrel, its lowest settlement value in a month.

Oil prices have been weighed down by fears that the Fed’s efforts to fight inflation will slow the economy and reduce demand for fuel. Still, energy prices remain near historically high levels as Russia’s invasion of Ukraine has caused Western nations to move rapidly away from Moscow’s supplies

The subsiding of oil prices from their highs may help stocks stabilize in the short term, as investors look for clues that inflation could begin to ease.

“For the stock market to stop going down, we need to catch a break here in terms of inflation,” said

Brian Barish, chief investment officer at Cambiar Investors. 

The move lower in crude prices dinged shares of energy companies. Shares of Occidental Petroleum declined $2.10, or 3.6%, to $55.77. Halliburton shares fell $1.46, or 4.4%, to $32.09. The S&P 500’s energy sector dropped 4.2% on the day.

Investors are worried that worsening economic data could precede a slowdown in U.S. growth, limiting nonessential spending. Economists surveyed by The Wall Street Journal have substantially raised the probability of recession, now putting it at 44% in the next 12 months, a level usually seen only on the brink of or during actual recessions.

“This narrative of recession is starting to lead the market,” said Sebastien Galy, a macro strategist at Nordea Asset Management.

Concerns about a recession have also hit prices for base metals. Copper fell 2.3% to $3.95 a pound, its lowest settle value since February 2021.

U.S. stocks have gyrated in recent weeks as soaring inflation and slowing growth hang over markets.

Photo: Seth Wenig/Associated Press

“There is certainly an anxiousness in markets and that’s playing through in volatility,” said Edward Park, chief investment officer at U.K. investment firm Brooks Macdonald, adding that investors are likely awaiting fresh inflation data or a central bank meeting to assess their future trades.

The dollar value of bitcoin, the world’s largest cryptocurrency by market value, fell 4.5% from its 5 p.m. ET level Tuesday to trade at $19,898.29, according to CoinDesk. Cryptocurrencies have fallen recently amid broad investor desire to get out of speculative assets and concerns about the future of some crypto companies

Shares of cryptocurrency exchange Coinbase Global declined $5.58, or 9.7%, to $51.91.

Overseas, the pan-continental Stoxx Europe 600 declined 0.7% In Asia, major indexes closed with losses. South Korea’s Kospi declined 2.7%, China’s Shanghai Composite fell 1.2% and Japan’s Nikkei 225 edged down 0.4%.

—Hannah Miao contributed to this article.

Write to Karen Langley at karen.langley@wsj.com and Caitlin Ostroff at caitlin.ostroff@wsj.com