U.S. stocks surged Wednesday after Nike and FedEx reported better-than-expected earnings, tamping down concerns of a recession.

The Dow Jones Industrial Average rose 526.74 points, or 1.60%, to close at 333,376.48. The S&P 500 rose 56.80 points, or 1.49%, to close at 3,878.42, and the Nasdaq rose 162.26 points, or 1.54%, to close at 10,709.37.

Shares of Nike (NKE) jumped 12.17%, or $12.56 a share, to close at $115.77 after reporting income for the three-month period ended Nov. 30 was $1.33 billion, or $0.85 per share, compared with $1.34 billion, or 83 cents per share, a year earlier.

Analysts had expected $0.64 a share.

FedEx (FDX) stock rose after it reported earnings that were also beat expectations. Analysts had expected earnings to plunge 42% to $2.81 per share for the three-month period ending Nov. 30. Instead, FedEx's reported income dropped 34% to $3.18 per share. FedEx stocked rose 3.41%, or $5.61, to close at $169.96.

Wednesday was the second day in a row that stocks advanced generally after nearly two weeks of losses. Growing concern that the Federal Reserve's efforts to stifle inflation will push the economy into recession have weighed down share prices in recent weeks. The Fed raised its rate by 0.5% last week after raising rates 0.75% in the three previous months.

Recent economic data show the rate of inflation to be slowing. Nonetheless, Fed Chairman Jerome Powell said more positive data would be needed before the central bank stops raising interest rates. Powell signaled more rate hikes are likely in 2023.

Some stocks that rose Wednesday included Netflix (NFLX), which closed at $297.96, up $9.77, or 3.39%. Apple's (AAPL) price of shares rose $3.15, or 2.38%, to close at $135.45.

"We got sort of oversold and I think the market was looking for an excuse to rally, and the Nike and FedEx number provided that," Sam Stovall, chief investment strategist at CFRA Research, told CNBC. "I really question, however, if this is something that's going to be long-lasting."