Health savings accounts are surging in popularity — and that can lead to some complications for older workers who enroll in Medicare.

Health savings accounts (HSAs) are offered to workers enrolled in high-deductible health insurance plans. The accounts are used primarily to meet deductible costs; employers often contribute and workers can make pretax contributions up to $3,350 for individuals and $6,750 for families; the dollars can be invested and later spent tax-free to meet health care expenses.

Twenty-four percent of U.S. workers were enrolled in high-deductible health plans last year, according to the Kaiser Family Foundation — and 15 percent of them were in plans coupled with an HSA.

But as more employees work past traditional retirement age, some sticky issues arise for HSA account holders tied to enrollment in Medicare. The key issue: HSAs can only be used alongside qualified high-deductible health insurance plans. The minimum deductible allowed for HSA-qualified accounts this year is $1,300 for individual coverage ($2,600 for family coverage). Medicare is not considered a high-deductible plan, although the Part A deductible this year is $1,288 (for Part B, it is $166).

That means that if a worker — or a spouse covered on the employer's plan — signs up for Medicare coverage, the worker must stop contributing to the HSA, although withdrawals can continue.

The normal enrollment age for Medicare is 65, but people who are still working at that point often stay on the health plans of their employers. In certain situations, the worker or a retired spouse might enroll for some Medicare benefits. Moreover, if the worker or spouse claims Social Security, that can trigger an automatic enrollment in Medicare Part A and B.

That would require the worker to stop contributing to the HSA — and the contributions actually would need to stop six months before that Social Security claim occurs. That is because Medicare Part A is retroactive for up to six months, assuming the enrollee was eligible for coverage during those months. Failing to do that can lead to a tax penalty.

Recognizing the problem, Sen. Orrin Hatch, R-Utah, and Rep. Erik Paulsen, R-Minn., proposed legislation last month that would allow HSA-eligible seniors enrolled in Medicare Part A (only) to continue to contribute to their HSAs.

The HSA complication is bound to arise more often as the huge baby boom generation retires, and as high-deductible insurance linked to HSA accounts continues to gain popularity among employers looking for lower premiums.

Some experts also pitch HSAs as a tax-advantaged way to save to meet health care costs in retirement — although the HSA's main purpose is to help people meet current-year deductible costs, and employers often make an annual contribution for that purpose.

Deciding to delay a Medicare enrollment depends on your individual circumstances.

If you work for an employer with fewer than 20 workers, Medicare usually is the primary insurer at age 65, so failing to sign up would mean losing much of your coverage — hardly worth the tax advantage of continued HSA contributions. If you work for a larger employer, Medicare coverage is secondary, so a delayed Medicare filing is more feasible — so long as you or a spouse are not enrolled in Social Security.

Mark Miller is a Reuters columnist.