HEMPSTEAD, N.Y. — Homeowners are lining up in droves at local tax collection offices, hoping for one last chance to take advantage of a major tax deduction before it is wiped out in the new year.

In Hempstead, town Tax Receiver Donald Clavin said “thousands” of people packed his office Tuesday trying to pay their 2018 property and school taxes a year in advance.

“This is almost chaotic,” Oyster Bay Tax Receiver James Stefanich told Newsday . He said homeowners began lining up in the cold an hour before his office opened.

Similar scenes played out at tax collection offices around the country in places with high local taxes.

The tax overhaul signed last week by Republican President Donald Trump puts a new $10,000 limit on the amount of state and local taxes people can deduct from their income when calculating their federal tax liability.

That new cap could translate into a tax hike of hundreds or even thousands of dollars in mostly wealthier, high-tax communities in California, Connecticut, New York and New Jersey and other states.

People in some communities are trying to effectively delay that hike for a year by paying their 2018 taxes in advance

The IRS said Wednesday that some homeowners who prepay local property taxes due in 2018 will be able to claim the deduction on this year’s returns, but only if the taxes have already been assessed and billed. People can’t guess at what next year’s assessment might be, pay it now and claim a deduction for that amount.

“A prepayment of anticipated real property taxes that have not been assessed prior to 2018 are not deductible in 2017,” the IRS said on its website.

That distinction wasn’t always clear to people flooding into local taxes offices after Christmas, or to the officials trying to help them. But most thought it was worth a try.

“I know later on it is going to hurt me,” Scott Arbuse, of East Meadow, New York, said of the disappearing tax deduction as he waited to make a payment. “But at least I save some money now.”

Across the country, Steve Sheffield made the same calculation as he went to pay his taxes in Sacramento, California.

“My accountant told me it was the thing to do,” Sheffield told the Sacramento Bee . “Next year, I probably won’t be able to itemize.”