NEW YORK – A rally that brought the stock market to record highs this year came back to life after U.S. home prices rose the most in seven years and consumer confidence reached a five-year high. As stock prices rose investors sold bonds, sending interest rates higher.

The Dow Jones industrial average rose 106 points to close at another record Tuesday, bouncing back from a loss the week before. The Standard & Poor’s 500 index also gained. The S&P is on track for its seventh straight monthly gain, the longest winning streak since 2009.

“They say the stock market tends to lead the economy. Now we’re starting to see the improvement on the economic front, so there’s some justification for this rally,” said Ryan Detrick, a strategist at Schaeffer’s investment research.

The yield on the 10-year Treasury note jumped to 2.17 percent, its highest level since April 2012, as investors moved money out of safe assets and into riskier ones like stocks. That’s a big jump from Friday’s level of 2.01 percent.

The stock market is coming off a rare loss last week, when both the Dow and the S&P 500 index had their first losing weeks in a month. Investors worried that the Federal Reserve might slow its extraordinary economic stimulus measures, which have also supported the stock market’s advance.

Part of the reason for the increase in bond yields is anticipation that the Fed may ease back on its $85 billion a month in bond purchases. Tim Courtney, chief investment officer at Exencial Wealth Advisors, is among those who see a bleak outlook for the bond market.

“The only way that bonds can make money from here is if we go a prolonged period of time with very, very low inflation and rates just don’t move up a whole lot at all,” said Courtney. “Under any other scenario they lose.”

The Standard & Poor’s/Case-Shiller survey, which was released before stock trading opened, found that home prices rose 10.9 percent in March, the most since April 2006.

Some analysts judged that investors were booking gains with the end of the month approaching on Friday. The Dow is up 3.8 percent so far in May. The S&P 500 is 3.9 percent higher.

“It’s the end of the month,” said Quincy Krosby, a market strategist at Prudential Financial. “If you’ve been long and you’d done very well you want to lock in those gains.”

The Dow closed 106.29 points, or 0.7 percent, higher at 15,409.39. The index has risen for 20 straight Tuesdays. The longest streak of consecutive gains for any day of the week was sent in 1968, when there were 24 gains on Wednesdays, according to Schaeffer’s Investment Research.

The S&P 500 index rose 10.46 points, or 0.6 percent, to 1,660.06. The Nasdaq composite index climbed 29.74 points, or 0.9 percent, to 3,488.89.

The gains were broad. Eight of the 10 industry groups in the S&P 500 index rose, led by financial stocks. The only ones that fell were utilities and telecommunication stocks, which investors tend to buy when they’re seeking stable, safe stocks that pay high dividends. All but six of the 30 stocks in the Dow rose.

The Dow has advanced 17.6 percent this year and the S&P 500 index is 16.4 percent higher as investors have piled into stocks.