D.C. is one of the most expensive housing markets in the country, but just a two-hour drive away is one of the least expensive.

WASHINGTON — D.C. is one of the most expensive housing markets in the country, but just a two-hour drive away is one of the least expensive.

The National Association of Realtors says the median price of a home that sold in Cumberland, Maryland, in the first quarter was just $81,800, making Cumberland the second-most affordable market for homebuyers in the nation, ahead of only Youngstown, Ohio, with a first quarter median price of $79,200.

Cumberland also saw one of the largest year-over-year gains in median selling prices in the first quarter, up 21.4 percent from the first quarter of 2016.

In addition to Youngstown and Cumberland, the rest of the five least-expensive housing markets in the country in the first quarter were Decatur, Illinois, Elmira, New York, and Binghamton, New York.

San Jose, California, has now eclipsed San Francisco as the most expensive housing market in the nation, with a median price in the first quarter of nearly $1.1 million, up 10.3 percent from a year ago.

The rest of the five most expensive housing markets in the first quarter were San Francisco, Anaheim-Santa Ana, California; Honolulu and San Diego.

The median price of what sold in the D.C. metro in the first quarter was $383,500, according to the National Association of Realtors, up 4.1 percent from the first quarter of 2016.

Nationwide, first quarter median prices were up an average 6.9 percent from the same quarter last year, driven higher by what it calls the strongest quarterly sales pace in a decade.