The Dow Jones industrial average closed higher for the first time in six sessions on Wednesday, recovering from sharp losses seen earlier in the day, as Boeing soared on strong earnings.

Boeing rose 4.2 percent after reporting quarterly results that easily beat analyst expectations. The stock's rise helped the Dow bounce back from a 201.05-point deficit and snap a five-day losing streak. The Dow closed at 24,083.83, up 59.70 points.

The also erased earlier losses, closing 0.2 percent higher at 2,639.40. The Nasdaq composite, meanwhile, slipped 0.1 percent to 7,003.74.

Stocks fell sharply earlier in the day as interest rates rose to levels not seen in years.

The benchmark 10-year Treasury yield traded at 3.03 percent after breaking above 3 percent for the first time since 2014 on Tuesday. Investors are worried rising borrowing costs may slow the economy and hurt companies' ability to buy back their own stock.