WINTHROP — Peter Nielsen, who has served as Winthrop’s town manager for the last two years, announced on Monday night that he is resigning after discovering he had made a $166,000 error.

Nielsen made the announcement near the end of a lengthy meeting of the Town Council, in which town and school budgets were also given votes of approval.

Before announcing his resignation, Nielsen said that an error in the current year’s town taxes was just recently discovered, and he said he was taking responsibility for it.

According to Nielsen, local officials incorrectly counted twice about $166,000 in state revenue last year, when they were preparing the current year’s taxes.

That mistake was on top of a large shortfall that was already in the school budget because of other funding errors.

“The error meant we did not collect enough tax, worsening the town’s financial condition by compounding the other errors we were examining,” Nielsen said, reading from a letter. “This error occurred on the municipal side. This makes it my responsibility.”

The full impact of the newly announced error on the town’s current and future finances was not immediately clear.

Nielsen was planning to leave his position next spring, but he said the discovery is “accelerating my plan.” He said he will work until June 30.

The Town Council also held an executive session to determine the process for finding another town manager.