As New York City’s real estate market foundered during the pandemic in 2020, home sales in the Hamptons boomed.It began with a rush for spring rentals. New Yorkers sought beach access and airy quarters months earlier than they had in previous years. Then, as the weather warmed, many of those renters, who were paying exorbitant monthly prices, began to buy. Others joined them, and the buying spree continued through the fall and winter, as the housing supply on the East End of Long Island dwindled and prices climbed.Sales in the Hamptons rose annually at the highest rate in a decade, according to a new report from Douglas Elliman. For the year 2020, the median sale price hit $1,202,500, a 40 percent increase from 2019 and the first time the year-end price broke the million-dollar threshold. The number of sales for the year rose by 37 percent, to 2,186, compared with 1,597 in 2019.Record-low mortgage rates have enabled buyers to pay inflated home prices, and many Manhattan office workers who have spent the pandemic working from homes on the East End have helped turn the Hamptons and the North Fork into year-round communities, at least for now.“The East End has, to a large degree, been the beneficiary of the challenges faced in the city,” said Jonathan Miller, an appraiser and the author of the year-end report. “This region is having its day.”In Manhattan, agents and sellers have suffered through a grim year, seeing only glimmers of a recovery. The ban on showings early in the pandemic shut down the market, which did not rebound to 2019 levels when it opened back up. More than 400,000 New Yorkers left the city last spring to wait out the pandemic elsewhere, and many extended their plans to stay away from New York.In the Hamptons, sales and prices broke records even in the usually sleepy months at the end of the year. In the fourth quarter, sales more than doubled compared with the year before, with 803 sales, according to the Douglas Elliman report, and the median home price increased by 55 percent, to $1.4 million.The price uptick, however, is less about rising prices in the overall market and more about strong sales activity at the high end, Mr. Miller said, as affluent New Yorkers and other buyers who fled to the East End of Long Island paid prices that took the high end to new heights. Corcoran reported that the number of sales in the Hamptons over $5 million nearly tripled in the fourth quarter, and the median sale price for the luxury market — defined as the top 10 percent of sales — rose 12 percent, to $7.2 million.One result of all this activity: a decreasing supply across the market. The number of listings dropped 9 percent, to 1,745, versus 1,919 in the same period last year, according to Douglas Elliman.The market on the North Fork, where home prices are lower, performed similarly. In 2020, the median sale price there increased by 24 percent, to $805,000, while inventory shrank by 61 percent from 2019, to 136 listings.Analysts and brokers alike are questioning whether this level of activity is sustainable. Low mortgage rates are likely to hold for the time being, but the future of commuting is less clear. As vaccinations become available, companies are weighing options to reopen offices to workers in 2021. Still, the virus has been unpredictable, and working from home has become a way of life for many.Robert Nelson, the executive managing director in the Hamptons for Brown Harris Stevens, said that although the initial pandemic rush to buy is over, “it still seems like the people who had long-term plans to secure a Hamptons home are just bringing their timelines up by a few years.”J.B. Andreassi, a broker in the Southampton office of Nest Seekers International, emphasized that the supply issue may be the most important factor in a limited market that has seen so much activity.“The amount of transactions can’t keep pace in 2021 compared to what’s happened in 2020, because the amount of options out there have totally dissipated,” he said. “There’s really very few options left that are good-quality purchases and investments for people.”For weekly email updates on residential real estate news, sign up here. Follow us on Twitter: @nytrealestate.