Sales of single-family homes in Maine dipped slightly in July, while the median sale price increased by nearly 5 percent.

The Maine Association of Realtors reported Wednesday that 1,710 homes changed hands in July, 2.2 percent fewer closings than in July 2015. Meanwhile, the median sale price increased by 4.7 percent to $197,700. The median indicates that half of the homes were sold for more and half sold for less.

Association President Ed Gardner said the sales decrease was likely the result of a shortage of available housing inventory for buyers. He said the increase in median price is also consistent with a relative shortage of supply compared with demand.

“For the past year, Maine has enjoyed a healthy real estate market,” Gardner said. “We have experienced month-over-month increases of both unit sales and median sale prices, almost 10 percent in units sold, from this past quarter to the same in 2015.”

Benjamin Bisson of Bisson Real Estate in Woolwich said that in the midcoast area, the inventory crunch is particularly an issue at the low end of the price spectrum. While there are first-time buyers in the market looking for starter homes, he said, most of what’s available for sale is beyond their price range.

And because construction costs are relatively high, there are very few homebuilders targeting first-time buyers in Maine, Bisson said.

“Construction at an entry level is basically nonexistent,” he said.

Still, Bisson said the luxury home market has been very strong, and to a slightly lesser extent the middle price range for move-up buyers.

In general, both home sales and median price have been trending upward in Maine.

During the three-month period ending July 31, home sales in Maine were up 9.7 percent from a year earlier, and the median price increased by 4.8 percent to $196,000, according to the association.

The biggest sales spike during that period was in Franklin County, where home sales increased by 49.4 percent compared with the same period of 2015. The only county that experienced a decrease in home sales was Piscataquis County, where sales decreased by 1.2 percent. In Cumberland County, sales increased by 1.2 percent.

The biggest increase in median price for the three-month period was in Lincoln County, where the median increased by 16.6 percent from a year earlier to $199,750. The biggest decrease was in Franklin County, where the median price fell by 14.2 percent to $118,000.

Also on Wednesday, the National Association of Realtors said sales of detached, single-family existing homes nationwide were down 0.8 percent in July compared with a year earlier. The national median sale price of $246,000 was up 5.4 percent from July 2015. Regionally, sales in the Northeast eased 5.7 percent, while the regional median sale price rose 3.3 percent to $284,000.