Long Island home sales surged last month — soaring by 25 percent in Nassau County — as homebuyers fled high-priced Manhattan in favor of the Island’s less-expensive homes.

The bustling local market bucked a national trend of sluggish sales. In Nassau County, 934 homes changing hands in March, compared with 747 a year earlier, the Multiple Listing Service of Long Island reported Friday. Sales in Suffolk County rose at a 7.7 percent annual rate, with 923 closed transactions.

Prices increased only modestly despite the sales activity. Nassau’s median home price rose 3.6 percent from a year earlier, to $430,000, the listing service reported. In Suffolk, the median price ticked up by 1.6 percent year-over-year, to $309,990.

See alsoLI home prices, sales activity

The Island is benefiting from the turbocharged housing market in Manhattan, where the average price exceeded $2 million for the first time in the first three months of 2016, said Dottie Herman, chief executive of Manhattan-based Douglas Elliman Real Estate.

“If you’re coming from the city, Long Island’s a bargain,” Herman said. “For a million or $800,000, you can buy a really nice house on Long Island. In the city, I don’t even want to tell you.”

It was the second month of dramatic gains in the selling pace on the Island. In February, home sales rose annually by 22 percent in Nassau and 28.5 percent in Suffolk.

advertisement | advertise on newsday

By contrast, across the country the number of sales inched up by 2.2 percent year-over-year in February, the most recent National Association of Realtors figures show.

Local brokerages have seen an influx of buyers priced out of New York City.

“People tell me it’s crazy how little you get in Manhattan,” said Russ Bonanno Jr., an agent with Bon Anno Real Estate in Massapequa. Some buyers tell him they live in studios the size of a typical Long Island master bedroom, and their rent exceeds a typical Long Island mortgage payment, Bonanno said.

“That definitely drives some buyers to Long Island, that’s for sure,” he said.

Nationally, home sales are strongest in and around cities, because that’s where millennials find jobs and appealing night life, said Herman, whose brokerage operates in the Northeast as well as Florida, California and Colorado.

Long Island’s schools are a major draw for young families, Herman said. However, she cautioned, if the Island wants to attract the nation’s largest demographic group — adults up to their mid-30s — it needs to revitalize its downtowns, she said. “They don’t want to be in a sleepy little town,” she said.

Long Island’s housing market appears likely to remain busy this spring. The number of contract signings increased year-over-year by 29 percent in Nassau and 36 percent in Suffolk last month, the listing service reported.

Sellers are in a stronger position in Nassau than in Suffolk, by one measure. It would take 6.2 months to sell all listed homes in Nassau at the current pace, compared with 9.8 months in Suffolk, listing service figures show. A balanced market has a six- to eight-month supply of homes, brokers say.

advertisement | advertise on newsday

Suffolk’s longer commute into the city poses a challenge for some buyers who work in Manhattan, said Anna Tambasco, owner of Advantage + Realty in Copiague. Costly flood insurance premiums in waterfront areas and a backlog of foreclosures and short sales also put a damper on the market, she said.

But low interest rates are giving buyers a boost, she said. The average rate for a 30-year, fixed-rate mortgage fell to 3.59 percent last week, the lowest level since last February, mortgage giant Freddie Mac reported.

“I’m getting more young couples starting to buy,” Tambasco said.

A few years ago, many would-be buyers “hesitated because they were worried about their jobs,” Tambasco said. “Now they’re starting to feel more secure. If they’re still at their jobs, they’ve decided, ‘OK, it’s time to do something now.’ ”