U.S. stocks moved higher Tuesday afternoon as investors welcomed solid results from homebuilders, retailers and other companies. Technology stocks and banks also rose. The rally briefly placed the S&P 500 on track for an all-time high. The benchmark index of large U.S. companies was hovering just below its last closing high set seven months ago.

KEEPING SCORE: The S&P 500 rose 5 points, or 0.2 percent, to 2,862. The Dow Jones Industrial Average gained 63 points, or 0.25 percent, to 25,822. The Nasdaq composite added 38 points, or 0.5 percent, to 7,859. The Russell 2000 index of smaller-company stocks picked up 19 points, or 1.1 percent, to 1,718.

RECORD TERRITORY: Shortly before 1 p.m. Eastern Time, the S&P 500 briefly crossed above its latest closing high of 2,872 set on Jan. 26. The market took a steep plunge immediately after that, in early February, and has been mostly clawing higher since then, with some bumps along the way, thanks to a still-recovering economy and a boom in corporate profits. Stocks have been buffeted by concerns about mounting trade tensions this spring and summer, particularly with China. Signs of potential progress have helped stocks rally in recent weeks. S&P Dow Jones Indices, which compiles the S&P 500, says that on Wednesday, the current bull market become the longest in history, beating the bull run of the 1990s.

THE QUOTE: “That we got to these levels in January was a big surprise, more so than we’re back there now,” said Bob Doll, chief equity strategist at Nuveen Asset Management. “We’ve had a mildly higher market after the correction on the back of these amazing earnings.”

SOLID EARNINGS: Investors have had much to cheer about when it comes to company earnings this year, and the second-quarter reporting period has been no exception. Of the 93 percent of the companies in the S&P 500 that have reported quarterly results, 62 percent delivered earnings and revenue that beat analysts’ forecasts, according to S&P Global Market Intelligence. The strong earnings have been a source of encouragement for investors at a time of uncertainty over the trade disputes between the U.S. some of its biggest trading partners.

“In the absence of any new bad news, the trend for the market continues to be higher, and money continues to slowly flow in,” said Craig Birk, chief investment officer at Personal Capital. “Earnings season was phenomenal and that removed one worry. When people are just looking at companies and just looking at economic fundamentals, they feel good about things.”

HOME SWEET HOME: Toll Brothers jumped 13.3 percent to $39.34 after the luxury homebuilder reported earnings that came in well ahead of what analysts were expecting. Other homebuilders also got a boost. Lennar gained 4.3 percent to $53.33, while PulteGroup added 5 percent to $29.54.

WEAR IT WELL: TJX climbed 4.5 percent to $106.21 after the operator of T.J. Maxx, Marshalls and other discount retail chains reported quarterly earnings that topped Wall Street’s forecasts. Several other retailers also moved higher, including Best Buy, which rose 2.6 percent to $81.41.

HEALTHY QUARTER: Medtronic gained 5.7 percent to $95.18 after the medical technology company’s latest quarterly report card beat Wall Street’s projections.

FREE TRADE: Discount brokers fell sharply after CNBC reported that JPMorgan Chase will offer free online trading. ETrade fell 3.2 percent to $59.28. Charles Schwab lost 1.9 percent to $50.44. TD Ameritrade slid 6.5 percent to $56.25.

IN A JAM: J.M. Smucker slumped 5.9 percent to $109.07 after the maker of Jif peanut butter, Crisco cooking oil and other products reported quarterly results that fell short of analysts’ estimates. The company also trimmed its outlook for the year.

ENERGY: U.S. benchmark crude rose 1.4 percent to settle at $67.35 per barrel in New York. Brent crude, the standard for international oil prices, gained 0.6 percent to close at $72.63 per barrel in London.

BOND YIELDS: Bond prices fell. The yield on the 10-year Treasury rose to 2.85 percent from 2.82 percent late Monday.

CURRENCIES: The dollar rose to 110.41 yen from 110.23 yen late Monday. The euro strengthened to $1.1592 from $1.1467.

METALS: Gold rose 0.5 percent to $1,200 an ounce. Silver added 0.7 percent to $14.77 an ounce. Copper gained 0.9 percent to $2.71 a pound.

MARKETS OVERSEAS: Germany’s DAX added 0.4 percent, while France’s CAC 40 climbed 0.5 percent. Britain’s FTSE 100 slipped 0.3 percent. In Asia, Japan’s benchmark Nikkei 225 rose nearly 0.1 percent, while Australia’s S&P/ASX 200 lost nearly 1 percent. South Korea’s Kospi rose 1 percent. Hong Kong’s Hang Seng climbed 0.6 percent. Shares were higher in Taiwan but fell in Singapore.

© The Associated Press. All rights reserved.