US stocks reversed higher Thursday, with investors stopping a selloff that ran for two consecutive sessions and embracing risk even as a Federal Reserve official said the central bank needs to be aggressive in raising interest rates.

The S&P 500 and the Dow Jones Industrial Average rose for the first time in three sessions, as the tech-concentrated index rebounded from Wednesday's 2% slump.

The stock market appeared to absorb comments by the St. Louis Fed President who said the Fed is behind the curve in controlling inflation. The central bank will need to raise interest rates by 3 percentage points by the end of 2022, according to him. The fed funds rate was raised by 25 basis points in March.

The yield curve steepened Thursday. The 10-year yield increased 5 basis points to 2.65%, while the 2-year yield decreased 2 basis points to 2.45%. The spread between the 10-year yield and the 2-year yield had briefly inverted in recent days to warn of a recession.

The US indexes were at 4:00 p.m. on Thursday.

The minutes from the Federal Reserve's most recent meeting showed policymakers agreed on the need to raise interest rates to restore price stability with inflation sitting at 7.9%. It said it will reduce its balance sheet by 95 billion each month in May.

The Fed has stated in the past that it is committed to flexibility, but it is hard to see the Fed taking a stronger stance on rate hikes than the market is expecting. Callie Cox, US investment analyst at eToro, said in a note late Wednesday that the disparity between the market's expectations and the Fed's actual moves may open the door for more relief rallies down the road.

Economic and earnings data, while under pressure, looks decent and the Fed is aware of the risks to future growth.

The price target of the company was slashed byDeutsche Bank.

The tech sector is oversold due to fears of interest rate hikes. Apple, Microsoft, and cybersecurity names like ZScaler are some of the top picks by the firm.

The sector has room for as much as 40% more upside given that investors are underallocated in the space.

The oil prices were stable. West Texas Intermediate was down 1 cent at $96.22 per barrel. The international benchmark for crude oil fell a penny to $100.57 per barrel.

The price of gold rose to $1,935.70 per ounce.