By Chris Dieterich 

U.S. stocks rallied Thursday after an upbeat report on factory activity helped shift the focus away from concerns that the Federal Reserve might raise interest rates sooner than expected.

The Dow Jones Industrial Average climbed 108.88 points, or 0.7%, to 16331.05. The S&P 500 advanced 11.24 points, or 0.6%, to 1872.01, and the Nasdaq Composite Index gained 11.68 points, or 0.3%, to 4319.29.

The rally wiped away Wednesday's 0.6% drop in the S&P 500, which came after Fed Chairwoman Janet Yellen said in a news conference that the central bank could raise rates "something on the order of six months" after it winds down its bond-buying program. That could mean a rate increase as early as April of next year, instead of later in 2015, as many had expected.

Stocks had started Thursday's session lower, but major benchmarks turned higher after the Philadelphia Federal Reserve's manufacturing-activity index for March topped expectations. Other economic data were firm as well, giving credence to the idea that soft reports clouding markets earlier this year reflected cold winter weather rather than a true growth slowdown.

The rebound also came as investors rethought Ms. Yellen's comments.

Rick Fier, director of equity trading at Conifer Securities, said his firm's hedge-fund clients came in early Thursday with a less worrisome view of Ms. Yellen's statement, believing that Wednesday's snap reaction appeared to be disproportionate to the information.

"The first response is computer-driven," he said. "This [buying of stocks] is the humans who go home, rewatch the video, and think things over."

Thursday's positive economic reports also helped sentiment.

"Things are mending, things are improving," said Natalie Trunow, chief investment officer for equities at Calvert Investments, which oversees just over $13 billion. Ms. Trunow said she prefers shares of companies that generate the bulk of sales in the U.S. rather than abroad, including smaller companies.

Traders said that activity was relatively subdued, as it has been in most recent sessions.

Despite Thursday's rally in stocks, there were signs that investors were girding for rising rates. Utility stocks and real-estate investment trusts, which tend to lag as interest-rates rise, trailed during Thursday's rally, trading lower for most of the session.

"Following the Fed, we're seeing increased volume in rate-sensitive names," said Stacey Gilbert, an exchange-traded-fund strategist at Susquehanna Financial Group.

Financial stocks, which generally benefit from rising rates because banks can borrow more cheaply and lend at higher marks, outpaced the market. After the closing bell, the Fed's annual "stress tests" for banks showed the largest U.S. firms are strong enough to withstand a severe economic downturn, possibly opening up the door for dividends and buybacks.

Concerns that rising interest rates will translate into pricier home mortgages hit shares of home builders, despite upbeat quarterly earnings from Lennar, which slipped $1.02, or 2.5%, to $40.32.

But Lawrence Creatura, portfolio manager at Federated Investors, said he has been buying shares of home builders since the start of this year. The stocks have been bruised by weak economic data, and he believes they are candidates to bounce back as the weather improves.

"There has been confusion between economic trends and weather trends," said Mr. Creatura, whose firm oversees about $376 billion. "Weather doesn't just clog the highways; it clogs the economic data, too."

The yield on the 10-year U.S. Treasury note ticked higher to 2.775% on Thursday, after jumping 0.09 percentage points to 2.770% late on Wednesday. Yields rise as bond prices fall. Gold futures lost 0.8% to settle at $1,330.50 a troy ounce.

Crude-oil futures slipped 0.9% to $99.43 a barrel. The dollar edged higher against the euro and was little changed against the yen.

The Stoxx Europe 600 ended marginally higher. Germany's DAX 30 added 0.2%, while the U.K.'s FTSE 100 declined 0.5%.

Asian markets were broadly lower on Fed concerns, with China's Shanghai Composite shedding 1.4% to a two-month low and Japan's Nikkei Stock Average falling 1.6%.

Among stock movers, ConAgra Foods rose 40 cents, or 1.4%, to 29.99 after the packaged-food company's earnings surpassed its expectations, while sales narrowly missed Wall Street's estimates.

Shares of 3-D printing companies fell after ExOne, down 4.35, or 9.9%, to 39.40, swung to a fourth-quarter loss and reported a drop in revenue. Stratasys declined 1.90, or 1.6%, to 114.33; 3D Systems fell 2.20, or 3.5%, to 60.48.

Jabil Circuit slipped 52 cents, or 2.9%, to 17.74 after the contract electronics manufacturer swung to a loss in its most recent quarter and reported a decline in revenue on significant restructuring costs.

Write to Chris Dieterich at chris.dieterich@wsj.com

Lennar (NYSE:LENB)
Historical Stock Chart
From Jun 2024 to Jul 2024 Click Here for more Lennar Charts.
Lennar (NYSE:LENB)
Historical Stock Chart
From Jul 2023 to Jul 2024 Click Here for more Lennar Charts.