Montana has been in much better shape than much of the nation when it comes to foreclosures and the housing market tumble, but nonetheless the state has been in record territory over the past year, and Gallatin County has had some of the highest foreclosure rates in the state.

In Gallatin County, filing of foreclosure or trustee sale notices accelerated to a record 830 last year, according to the county clerk and recorder's office. That is 18 percent higher than 2009 and a dramatic 157 percent jump from 2008. The filings include residential and commercial real estate and raw land.

In Montana, only Flathead County appears to have had more foreclosure notices in 2010, with 1,177 filings recorded by its clerk and recorder's office. Missoula County listed 620. Yellowstone County had 593.

For the month of December, Park County had the fourth-highest number of foreclosures in the state, according to RealtyTrac, which compiles foreclosure data nationwide.

Montana is in much better shape than states like California, Florida and Michigan, which led the nation in foreclosures in December. That month, Montana was a distance 45th in new foreclosures nationwide.