Sales of new U.S. single-family homes increased more than expected in August after two straight monthly declines, but the underlying trend still pointed to a weakening housing market amid rising mortgage rates and higher home prices.

The Commerce Department said on Wednesday new home sales rebounded 3.5 percent to a seasonally adjusted annual rate of 629,000 units last month. July's sales pace was revised down to 608,000 units from the previously reported 627,000 units.

Sales in June were also much weaker than previously reported. Economists polled by Reuters had forecast new home sales, which account for about 11 percent of housing market sales, rising 0.5 percent to a pace of 630,000 units in August.

New home sales are drawn from permits and tend to be volatile on a month-to-month basis. They increased 12.7 percent from a year ago.

The housing market is lagging a robust economy, with data last week showing sales of previously owned homes flat in August and building permits plunging to a more than one-year low.

Read more from CNBC.