US stocks overcame a brief stumble to close slightly higher Wednesday, snapping a two-day losing streak.
The dip came after the Federal Reserve released its latest statement on interest rate policy and the economy, in which the central bank signaled that it expects inflation to pick up this year. The Fed, as expected, held off on raising interest rates.
Stocks bounced back in the last hour of trading, with gains by technology companies outweighing losses in health care and other sectors.
The latest batch of strong earnings from big companies, including Boeing, helped put investors back in a buying mood a day after the market had its biggest drop since August.
‘‘The markets have turned around,’’ said Erik Davidson, chief investment officer for Wells Fargo Private Bank. ‘‘Many people have been waiting for it to dip as it’s marched higher and higher, and we finally had two days of weakness, particularly yesterday.’’
The Standard & Poor’s 500 index rose 0.1 percent, to 2,823.81. The Dow Jones industrial average added 0.3 percent, to 26,149.39. The Nasdaq Composite rose 0.1 percent, to 7,411.48. The Russell 2000 index of smaller-company stocks gave up 0.5 percent, to 1,574.98.
All told, the indexes ended January with solid gains.
Boeing climbed 4.9 percent after the aerospace giant’s latest results topped Wall Street’s expectations. The stock has been the biggest gainer in the Dow over the past year.
Electronic Arts led the rally in technology companies, jumping 7 percent after the video game maker forecast quarterly earnings and sales well ahead of what analysts expected. The stock was the biggest gainer in the S&P 500.
Some 80 percent of the companies that have reported earnings in recent weeks have beat expectations. Typically, it’s around two-thirds. Management teams are also touting stronger sales growth than in previous quarters.
‘‘The combination is really helping drive the market higher and making investors feel more confident about the outlook for 2018,’’ said Kate Warne, investment strategist at Edward Jones.
The market was higher for most of the day but briefly gave up its gains after the Fed released its economic and interest rate policy update.
The central bank left its benchmark interest rate unchanged in a still-low range of 1.25 percent to 1.5 percent and signaled that it expects to resume raising rates gradually to reflect an improving, healthy job market and economy.
The Fed also said that it expects inflation to finally pick up this year and to stabilize around the Fed’s target level of 2 percent. In its previous statement, the Fed had predicted that inflation would remain below its target rate.
That revision appeared to put off some investors, triggering a sell-off that pulled stock indexes into the red until the last hour of trading.
Health care stocks posted the biggest decline for the second day in a row. Eli Lilly lost 5.4 percent, while Gilead Sciences gave up 4 percent.
Some companies’ quarterly report cards failed to impress traders.
Juniper Networks slumped 7.7 percent after the provider of network equipment forecast quarterly results that were well below what analysts expected. The stock fell more than any other company in the S&P 500. Textron shares fell 2.5 percent after the industrial conglomerate’s results fell of forecasts.
Bond prices didn’t move much. The yield on the 10-year Treasury remained at 2.72 percent after briefly moving higher.
The prospect for stronger economic growth, in the United States and abroad, has helped drive bond yields higher in recent months. This week yields have hovered at the highest level since April 2014. Rising yields make bonds more appealing to investors seeking income, but they can also lead to higher financing costs for companies, home buyers and other borrowers.