Arizona moved out of the worst 10 in state foreclosure rankings in July, for the first time since February 2007, a home marketing company reported Thursday.

RealtyTrac Inc. of Irvine, Calif., said in its monthly foreclosure report that it recorded 3,257 filings in Arizona, 60.4 percent fewer than in July 2012. RealtyTrac counts a filing as any notice of default, notice of auction and bank purchase after foreclosure. Thus, one property could have more than one filing against it, so the total number does not necessarily reflect the number of properties in foreclosure.

The state, with Phoenix in the lead, has been one of the hottest housing markets in the recovery of the last year, with inventories of unsold homes down and prices rising. In fact, RealtyTrac reported that Phoenix area foreclosure filings in July totaled 2,042, down 64.8 percent from last year.

Tucson and Pima County recorded 514 foreclosure filings in July, down 58.3 percent from July 2012, the report said.

The national picture also continued to show clear signs of improvement in most areas. RealtyTrac reported July filings were 31.8 percent below one year ago.

“U.S. foreclosure activity in July is 64 percent below the peak of more than 367,000 properties with foreclosure filings in March 2010, but is still 54 percent above the historical average of 85,000 properties with foreclosure filings per month before the housing bubble burst in late 2006,” RealtyTrac Vice President Daren Blomquist said in a press release.