Buyers drove up home prices early this year as they competed for the scarcest supply of Long Island listings in more than a decade.

Long Island homes sold for a median price of nearly $385,000 in the first quarter, up 4 percent from a year earlier, a report to be released Thursday by brokerage Douglas Elliman and appraisal company Miller Samuel shows.

The number of sales grew by 5 percent year-over-year, and the number of listings plummeted to 10,796, a 21 percent annual decline and the lowest level in 15 years. The figures do not include East End sales.

“The buyer demand is so strong that it’s driving down the inventory,” said Ann Conroy, president of Douglas Elliman’s Long Island division. “Everything that is priced properly is just flying off the shelves.”

Competition is especially fierce for renovated “entry level” homes selling for up to about $400,000, and “midrange” homes up to about $800,000, Conroy said.

By contrast, the luxury market cooled off, with the median price of the top 10 percent of sales falling by 9.5 percent, to $1,018,000, the report showed.

advertisement | advertise on newsday

“This is a pattern we’re seeing throughout the region,” said Jonathan Miller, chief executive of Miller Samuel. In the wake of the 2007-2009 recession, “the high-end market rose much faster than the economics supported, so now the market is drifting until it hits where it needs to hit.”

Many buyers are moving out of New York City, where housing values have soared, in search of good schools and larger homes at more affordable prices, Conroy said.

Nassau’s South Shore continued its steady recovery from the 2012 superstorm Sandy, with the median price rising by 8.4 percent year-over-year, to $437,250.

In Long Beach, the median price increased by 18 percent annually, to more than $540,000 in the first three months of 2017, a recent report by Daniel Gale Sotheby’s International Realty showed. Median prices in Seaford, Merrick, Wantagh and Lynbrook rose year-over-year by about 7 to 10 percent, the brokerage reported.

Those who work in Manhattan are eager to live in the towns along the Babylon train line, said Scott Wallace, a real estate agent with the brokerage in Rockville Centre.

“They don’t want to give up walking to the train station,” Wallace said.