WASHINGTON — Construction of single-family homes fell in June to the slowest pace in 17 years although a change in New York laws helped give a big boost to apartment building.

The Commerce Department reported Thursday that construction of single-family homes dropped by 5.3 percent in June to a seasonally adjusted annual rate of 647,000 units, the weakest performance since January 1991, another period when the housing industry was going through a severe downturn.

However, construction of multifamily units surged by 42.5 percent last month, thanks to a change in New York City building codes that spurred a wave of applications to build apartments in that area. Taken together, single and apartment construction rose by 9.1 percent to an annual rate of 1.066 million units.

"Ignore the June head-fake, housing starts continue to trend down and likely will continue to do so until demand perks up and inventories come down," said Sal Guatieri, an economist at BMO Capital Markets.

The total increase was viewed as an aberration that did not give a true picture of the continued weak state for the housing industry.

Wall Street, shrugged off the report and instead chose to focus on stronger-than-expected quarterly reports from JPMorgan Chase & Co. and United Technologies Corp. Those companies' earnings reports extended a rally into a second session on Thursday and may have offered investors some hope that their prior views of the economy had been overly pessimistic.

Private economists were not enthusiastic about by the housing report, however, stressing that the data was being skewed by the one-month spurt of activity in New York that was magnified by the fact that the government adjusts one-month changes to annual rates. Analysts predicted that housing will continue to be under strains for the rest of the year.

The troubles in housing, combined with related turmoil in the financial sector attributed to billions of dollars of losses on mortgage loans, are dragging down the total economy, raising risks of a recession.

Separately, the Labor Department reported that the number of newly laid-off people signing up for jobless benefits rose by 18,000 last week to 366,000, the highest level since late June. The increase was below the number that economists had been expecting.

The report on housing construction showed that applications for building permits, considered a good sign of future activity, rose by 11.6 percent to a seasonally adjusted annual rate of 1.091 million units. However, this increase was also skewed by a big rise in the volatile apartment sector. Permits for multifamily construction soared by 39.4 percent while permits for single-family homes fell by 3.5 percent.

Analysts said they expect that builders will continue to slash construction as they struggle with an extremely difficult environment. The National Association of Home Builders said Wednesday that its survey of builder sentiment fell to a record low of 16 in July, down from 18 in June,

That decline reflected all the problems facing the housing industry at the moment from a weak economy that is pushing down employment and consumer sentiment to surging mortgage foreclosures which are dumping more homes on an already glutted market.