Distressed home sales, including foreclosures and short sales, hit an 11-year low nationwide in the second quarter, but two Maryland cities are among those left behind.

WASHINGTON — Distressed home sales, including foreclosures and short sales, hit an 11-year low nationwide in the second quarter, but two Maryland cities are among those left behind.

In Baltimore, 20.7 percent of home sales in the second quarter were distressed sales, the highest percentage in the nation among cities with a metropolitan area population of 1 million or more.

Philadelphia, New York, Cleveland and Providence, Rhode Island, all had distressed sales of between 19 percent and 20 percent.

Among all 148 metropolitan areas Attom Data Solutions analyzed for distressed sales, Hagerstown, Maryland, ranks in the top five, at 22.1 percent.

And, while Attom Data Solutions says median selling prices nationwide in the second quarter rose to prerecession levels in 65 markets, the median prices in Salisbury, Maryland, was still 21 percent below the 2005 peak, ranking it in the top five among markets still far from previous highs.

The housing market continues to suffer from a lack of homes on the market for sale, and the Attom Data Solutions quarterly report finds one culprit.

Homeowners who sold in the second quarter had owned their homes for an average of 8.09 years, an all-time high for homeownership tenure.

Those who did sell, did well.

Average home seller gains increased to the highest level since the third quarter of 2007, with a 30.2 percent return on the original purchase price.