Stocks rebounded from a downbeat start Tuesday, building on small gains for the third day in a row.
News that U.S. consumer prices jumped sharply in May drove up long-term interest rates, setting the stage for the turnaround as investors bid up shares in financial stocks such as E-Trade Financial, Charles Schwab and Goldman Sachs.
Disappointing home construction data had weighed on the market early on, sending homebuilder stocks lower.
The major stock indexes recovered, but only barely above the previous day's close.
"The market is just kind of drifting along. Everybody is trying to figure out how much of a hold this economic expansion can get, if we can get some self-sustaining momentum going," said Brad Sorensen, director of market and sector analysis at the Schwab Center for Financial Research.
Investors may get a better sense of that on Wednesday afternoon, when the Federal Reserve is scheduled to give an update following a two-day meeting of its policy-making committee.
Fed officials are widely expected to keep a key short-term rate near zero. The Fed will also update its economic forecasts.
"We're all waiting to see what the Fed has to say tomorrow," said JJ Kinahan, chief strategist at TD Ameritrade.
The Standard & Poor's 500 index rose 4.21 points, or 0.2 percent, to 1,941.99. The index is down less than 1 percent from its most recent all-time high of 1,951.27 set last week.
Five of the 10 sectors in the S&P 500 rose, led by financials. Utilities fell the most.
The Dow Jones industrial average added 27.48 points, or 0.2 percent, to 16,808.49. The Nasdaq composite gained 16.13 points, or 0.4 percent, to 4,337.23.
The three stock indexes are all up for the year.
Stocks were down slightly in premarket trading Tuesday as investors got a look at the latest data on U.S. home construction. The Commerce Department reported that homebuilders broke ground on new apartments and houses at an annual rate of 1.01 million homes in May. That's down 6.5 percent from the previous month.
The report sent homebuilder shares mostly lower for much of the morning. Most recovered by the afternoon.
Separately, the Labor Department reported that U.S. consumer prices vaulted last month by the largest amount in more than a year, propelled by rising costs for food, gasoline and airline fares.
The bigger-than-expected hike in prices helped ease demand for government bonds, pushing down bond prices. The yield on the 10-year Treasury note rose to 2.65 percent from 2.60 percent late Monday.
Higher long-term interest rates can translate into more earnings for financial institutions that make loans.
E-Trade Financial was among the biggest gainers, rising $1.58, or 7.7 percent, to $22. Charles Schwab added $1.42, or 5.5 percent, to $27.30.
Banks including Goldman Sachs and Morgan Stanley also posted gains. Morgan Stanley rose 79 cents, or 2.5 percent, to $32.50, while Goldman Sachs gained $2.37, or 1.4 percent, to $168.22. Goldman rose the most of the 30 stocks in the Dow Jones industrial average.
By afternoon, stocks had climbed into positive territory and held on to their gains the rest of the day.
Solid quarterly growth in banking and trading at investment bank Jefferies Group LLC also raised hopes that investment banking could be strengthening, Kinahan said.
Among other stocks making news Tuesday:
-- GameStop surged 6.8 percent on a report from the NPD Group that revealed huge video game sales in May and likely some bigger margins for the video game retailer. GameStop rose $2.57 to $40.29.
-- UBS and Susquehanna analysts struck an optimistic tone about growth in the travel industry. That helped lift shares in travel website Expedia $3.04, or 4.1 percent, to $77.62. Orbitz Worldwide rose 38 cents, or 4.7 percent, to $8.50.