In this June 24, 2021, file photo, a real estate sign is posted in front of a newly constructed single family home in Auburn, New Hampshire. Credit: Charles Krupa / AP

Dava Davin’s eyebrows raised when she looked at home listings in the Portland area on Thursday.

There were only nine single-family homes for sale in Portland and five in South Portland, the founder of Portside Real Estate Group told a real estate conference.

“And if you like Yarmouth, well, guess what?” Davin said. “There’s zero homes for sale right now.”

That inventory shortage is a large part of what has driven up real estate prices in southern Maine and throughout the state over the past couple years. The median sales price of a home in Maine rose to almost $300,000 last year, a 21-year high, according to data released by the Maine Association of Realtors on Thursday.

The number of homes sold statewide rose about 2 percent for the year compared to 2020, but in December sales dipped by 12.6 percent, indicating that finding a home is getting more difficult.

This year is off to a rough start in terms of inventory. Listings in southern Maine, which includes Cumberland and York counties, were down more than 15 percent in early January.

“It’s going to get worse before it gets better,” Davin said, adding the tight market should ease toward the middle to end of this year.

Land sales for potential home-building and condominium sales are increasing to make up for the gap. Land sales were up 85 percent since 2019. Some 81 percent of condos sold for over asking price, while 76 percent of single-family homes did last year.

The luxury home market offered up surprising statistics, with 760 houses throughout Maine selling for more than $1 million, triple the number in 2019. They were snapped up quickly, with an average 10 days on the market compared with 63 days before the pandemic, she said.

Davin expects prices to keep rising this year, but they will be in the single digits at around 7 percent rather than the double-digit rates of the past year. Interest rates could rise to about 3.7 percent and dampen sales. Out-of-state buyers will continue to come to Maine, and there will be growth in rural real estate, she predicted.

“People will drive until they can afford it,” she said.