NEW YORK — Encouraging reports on hiring and growth in the service sector sent small companies and banks higher Wednesday and knocked bond prices into a tailspin. The yield on the benchmark 10-year Treasury note spiked to its highest level in more than seven years.

Both reports were stronger than analysts expected and suggest the economy is in good shape in spite of rising interest rates and the ongoing U.S.-China trade dispute.

“This is evidence of strong economic growth and the likelihood earnings will continue to be good,” said Ameriprise Chief Market Strategist David Joy. While some experts think the economy will slow somewhat in the third and fourth quarter, Joy’s view is that “we’re not going to get much of a slowdown.”

The S&P 500 index added 2.08 points, or 0.1 percent, to 2,925.51. The Dow Jones Industrial Average gained 54.45 points, or 0.2 percent, to 26,828.39, another all-time high. It was up as much as 177 points earlier. The Nasdaq composite picked up 25.54 points, or 0.3 percent, to 8,025.09.

The Russell 2000 index of small-company stocks climbed 15.25 points, or 0.9 percent, to 1,671.29. Those companies, which tend to be more focused on the U.S. market than large multinationals, stand to benefit more from strong economic growth at home.

The survey on private company hiring by ADP raised expectations for the government’s broader jobs report due out Friday, which tends to have an even bigger effect on markets. The Institute for Supply Management, the trade group, said its index measuring the service sector reached the highest level in a decade.

The solid reports helped companies that do better when businesses and consumers spend more money, like technology and industrial stocks. Apple rose 1.2 percent to $232.07 and Caterpillar rose 2.2 percent to $158.22.

Investors were willing to bet on continued economic growth, and that meant bond prices dropped sharply, sending yields soaring. The yield on the 10-year Treasury note rose to 3.18 percent, its highest since July 2011 and up from 3.05 percent a day earlier.

That helped banks, which are able to charge higher interest rates on long-term loans when bond yields rise. Comerica rose 2.6 percent to $92.09 and Bank of America added 1.4 percent to $30.