San Joaquin County foreclosure activity tumbled in 2013, with legal filings falling by more than half from 2012, RealtyTrac Inc. is reporting today.

The county ranked 25th among large U.S. metropolitan areas in foreclosures, with filings - default notices, scheduled auctions and repossessions - equal to 1.7 percent of all housing units, or one in 60. It was the first time since the housing bubble burst in 2006 that the region lost the dubious distinction of being at or near the top in annual filings.

Put another way, San Joaquin County - known demographically as the Stockton metropolitan area - saw more than 3,900 foreclosure filings in 2013, down 58 percent from the more than 9,300 filings the year before.

That is a far cry from the height of Stockton's housing crisis, when in 2008, filings totaled more than 21,100 and topped 19,500 in 2009, said Daren Blomquist, a RealtyTrac vice president.

"Stockton is no longer one of the epicenters of the foreclosure crisis," he said. "It still has a foreclosure rate that is higher than the national average, but it's not one of the headline markets when it comes to foreclosures. That certainly is a significant shift for a market that seemed it was perpetually being hit hard by the foreclosure crisis."

Some areas of the country continue to be plagued by foreclosures. Florida, where Miami and seven other Florida metro areas posted 2013 rates among the 10 highest in the country, leads the way.

But Blomquist said that nationally, the housing crisis is coming to an end.

"The juggernaut was once rising foreclosures, and now it's falling foreclosures," he said. The country could well return to pre-recession levels of foreclosure activity by early in 2015, he said.

And Stockton may be ahead of that pace.

Blomquist said the county saw a monthly average of 455 foreclosure filings in 2013; in 2006, when housing prices peaked, the monthly average was 434. "So we're really right there."

And the improvement seems to be continuing.

In the last three months of 2013, Stockton foreclosure filings were down 62 percent from the same period of 2012. The area ranked 36th among large U.S. metros.

Nationwide, RealtyTrac reported 1.36 million foreclosure filings in 2013, down 26 percent from 2012 and 53 percent lower than the peak of 2.9 million filings in 2010. It was the lowest annual total since 2007, when the tally reached 1.3 million foreclosure actions.

Those 2013 filings amounted to about 1 percent of all U.S. housing units, a rate about 40 percent lower than in Stockton. The rate in California last year was also about 1 percent.

One lingering doubt, Blomquist said, was the state's Homeowners Bill of Rights, which took effect Jan. 1.

Because it raises new barriers to bank repossessions, the new law may slow the pace of foreclosure activity for a time, only to let it rev back up later this year.

"The overarching story is we're getting back to normal, but the Homeowners Bill of Rights may have thrown a wrench into the process a little bit," he said.

After Florida, where 3 percent of all housing units were affected by a foreclosure filing in 2013, states with the highest foreclosure rates last year were Nevada, 2.2 percent; Illinois, 1.9 percent; Maryland, 1.6 percent; and Ohio, 1.5 percent.

RealtyTrac also reported that in the preceding eight years, 10.9 million U.S. properties had started the foreclosure process and 5.6 million have been repossessed by lenders.