A scarce supply of listings and an unseasonably hectic sales market drove up Long Island home prices in the last three months of 2016, a new report shows.

Homes sold for a median price of $389,450 on Long Island during the fourth quarter, up 4.9 percent from a year earlier, according to a report to be released today by the brokerage Douglas Elliman and appraisal company Miller Samuel.

There were slightly more than 11,000 homes listed for sale, the smallest number in at least 13 years. Despite the tight inventory, buyers closed on 7,008 sales, an annual increase of 7.4 percent and the most active fourth quarter since 2004. The figures do not include East End sales.

By contrast, the Hamptons median home price dropped by 7.2 percent, year over year, to $925,000 in the fourth quarter, and the number of sales fell by 14.5 percent, Douglas Elliman and Miller Samuel reported. On the North Fork, the median price increased by 13.9 percent, year over year, to $595,000.

Long Island communities closer to the city are seeing an influx of young adults up to about age 35, brokers said. As they have children, young professionals who have lived in the city for years are starting to look for houses on Long Island, where they can find larger homes and good schools, said Dottie Herman, chief executive of Douglas Elliman. “They can get so much more in the suburbs,” Herman said.

Those young families are competing with baby boomers for entry-level and moderately priced homes, especially in areas close to downtowns and train stations, said Deirdre O’Connell, general sales manager for Cold Spring Harbor-based Daniel Gale Sotheby’s International Realty.

advertisement | advertise on newsday

In Syosset, for instance, “we’re seeing values exceeding expectations in and around town,” O’Connell said. The median price in Syosset increased by 8.6 percent from 2015 to 2016, to $687,750, a new report from Daniel Gale Sotheby’s shows.

The demand for moderately priced homes is fueled in part by rising city prices, which have pushed many buyers out to Long Island, said Jonathan Miller, chief executive of Manhattan-based Miller Samuel.

By contrast, he said, buyers with multimillion-dollar budgets “aren’t leaving the city like the entry and mid tier is, so you’re not getting that surge in demand” for luxury homes on Long Island.

Gary Baumann, an associate broker with Douglas Elliman in Huntington and Port Washington, said he encourages sellers to enter the market before the spring rush, as the competition among buyers is so strong right now. “This time of year there’s so little inventory,” he said.

However, baby boomers who want to downsize can get discouraged by the high prices of condominiums, especially newly built ones, he said. “Typically, new construction is going to be at the top of the market,” so a condo might be just as expensive as a single-family home, Baumann said.

Even on the East End, buyers are favoring more reasonably priced properties, particularly those west of the Shinnecock Canal, brokers said.

For instance, Hampton Bays home prices rose by 3 percent annually, to a median of $432,000 in the fourth quarter, while values fell in several communities further east, according to a report being released today by the Corcoran Group. In Bridgehampton and Saga ponack the median price fell by 34 percent, to $2.1 million, the report showed.

Uncertainty about the presidential election caused some buyers to hesitate, said Ernest Cervi, Corcoran’s executive managing director for the East End. But house hunters returned in December, buoyed by the mild weather and predictions that the election of Donald Trump would benefit the housing market, he said.

advertisement | advertise on newsday

Hamptons buyers were “sitting on the sidelines and waiting to see what was going to happen,” he said. “Every time there’s an election, people say, ‘OK, let’s hit the pause button.’ ”