LOS ANGELES – The U.S. is on track to end the year with the fewest homes repossessed by lenders in six years, a trend that should help limit the negative impact foreclosures have on home values.

Lenders repossessed 36,964 U.S. homes last month, down 31 percent from July last year, foreclosure listing firm RealtyTrac Inc. said Thursday.

At the monthly average pace through July, completed foreclosures are projected to total nearly 490,000 this year, down roughly 27 percent from last year, the firm said. That’s also the lowest since 2007, when 404,849 homes were taken back by banks.

Foreclosures peaked in 2010 at 1.05 million and have been declining ever since. The trend has been accelerating as U.S. home prices have increased amid a resurgent housing market.

Lenders initiated the foreclosure process on 60,601 homes in July, down 38 percent from a year earlier, RealtyTrac said.

Foreclosure starts and the number of homes repossessed by banks each increased 6 percent and 4 percent, respectively, from June. But annual increases, which are more telling of the long-term trend, occurred in less than half of the states.

Some 9.7 million homes, or 19.8 percent of all U.S. homes with a mortgage, were in negative equity at the end of the first quarter, according to data provider CoreLogic. That’s down slightly, from 10.5 million, or 21.7 percent of homes with a mortgage, at the end of last year.