Long Island home sales surged late last year, giving prices a modest boost.

The median sale price rose to $371,383 in the last three months of 2015, a year-over-year gain of 2.6 percent, the brokerage Douglas Elliman and appraisal firm Miller Samuel said in a report due to be released Thursday.

The number of sales jumped by 13 percent compared to the same period in 2015. The figures do not include East End sales.

The housing market’s overall gains came despite a drop-off in prices for luxury homes. Looking only at the top 10 percent of sales, the median price fell annually by 5.5 percent, to $999,000.

Long Island is benefiting from New York City’s increasingly out-of-reach home prices, Dottie Herman, chief executive of Manhattan-based Douglas Elliman.

“The strength of the city pushes people out to the suburbs,” with Long Island’s high-performing schools a major draw, Herman said.

Plus, she said, millennials — those ages 18 to 34 — are finally starting to buy homes as the economy improves, Herman said. Long Island’s jobless rate fell to 3.9 percent in December, the lowest rate since 2007, the state Labor Department reported this week.

advertisement | advertise on newsday

Younger buyers are seeking walkable communities, like the Village of Huntington, rather than spacious mansions, Herman said. “They would settle for a little less house, size-wise, if they have the amenities and the conveniences that they want.”

Suffolk County saw stronger price gains than Nassau County. The median home price in Suffolk was $320,000 in the October-to-December period, up 4.9 percent from a year earlier; by contrast, Nassau home prices increased by 2.4 percent, to $435,000.

Homebuyers are “searching for greater affordability” in farther-flung suburbs, a trend seen throughout the New York metropolitan region, said Jonathan Miller, chief executive of Manhattan-based Miller Samuel. “We’re starting to see the suburban markets that surround the city see a lot more sales,” he said.

Despite the relative weakness at the top of the market for Long Island outside the East End, the median home price in the Hamptons ticked up by 2.3 percent year-over-year, to $997,000, Douglas Elliman and Miller Samuel reported. In the North Fork, homes sold for a median price of $522,500, an annual jump of 14 percent.

Buying a vacation home on the East End has become increasingly appealing, as concerns rise about security in Europe and other holiday destinations, Herman said.

@Newsday

“A lot of people said, ‘it’s a safe place to put my money and it’s a scary world,’” she said. Plus, Herman said, the federal government’s recent move to demand more information about luxury sales in Manhattan and Miami-Dade County could benefit the East End. The Treasury Department said this month it would require shell companies paying cash for properties in those areas to disclose the identities of those making the purchases.

That could push some buyers seeking secrecy to the Hamptons, where they would not need to disclose that information, Herman said.

The end of 2015 marked the fourth straight quarter in which Hamptons median sales prices have made annual gains while inventory has fallen, said Ernest Cervi, regional senior vice president for the East End at the Corcoran Group, a real estate brokerage based in Manhattan. “It’s trending in the right direction,” he said.

The rental market also has seen plenty of activity, he said. Cervi predicted that the Hamptons sales and rental markets alike would thrive this year.

“I think people are going to stay closer to home as opposed to traveling,” Cervi said.