You’re probably spending more money on your grandchildren then you realize, and it could hurt your retirement.

Grandparents are spending a lot of money on their grandchildren, according to an AARP study. On average grandparents spend $2,572 annually on the grandchildren, according to the study. But that’s only an average. Many spend much more. Also, it’s a self-reported figure. I suspect many grandparents are spending more on their grandchildren than they realize.

Part of being a grandparent in America seems to be spoiling the grandchildren. But too many grandparents, without realizing it, are harming their own financial security through their spending on the grandkids.

Most grandparents don’t consider themselves to be financial supporters of their grandkids. About 79% of grandparents in the study believe they’re not providing support to the grandchildren, only giving gifts or treating them to days out.

Yet about 94% of grandparents go further, providing the grandchildren with some form of financial support, the research concluded.

Many people become grandparents during their working years, so they become used to spending money on the grandchildren out of their earnings. Yet, they often continue that spending during retirement, and a considerable number step up their spending as the grandchildren get older.

Grandparents almost universally consider higher education for their grandchildren to be an important goal. More than 20% say they contribute to school or college tuition for the grandchildren.

For some grandparents that means taking on debt. It also means diverting savings or income from their own spending to spending on the grandchildren. About 7% of grandparents said they personally took on debt to pay for the grandchildren’s college. Another 25% cosigned private student loans for the grandchildren or incurred credit card debt that hasn’t yet been paid.

Another segment of grandparents are the main caregivers for grandchildren. Almost 8%, or 7.7 million, grandparents have grandchildren living with them. About 22% of those grandparents say the financial cost of being caregivers for the grandchildren is too much for them.

Longer life spans are making this situation worse.

As people live longer, they’re acquiring not only more grandchildren but also great-grandchildren. Some 96% of Americans are grandparents by age 65. The AARP report estimated that by 2030 more than 70% of U.S. children eight years old will have at least one living great-grandparent.

I’m not telling you to avoid helping grandchildren and great-grandchildren. But you should know that providing too much help for relatives, especially grandchildren, is a major cause of people losing their financial security during retirement.

Too many grandparents spend money freely on their grandchildren and assume they’ll make up for it by reducing spending in other areas. Too often, things don’t work out that way.

It’s important that you decide how much financial help you want to provide grandchildren and great-grandchildren. This should be a line item in your spending plan for retirement. You need to adhere to it.

Keep in mind that the spending plan can be adjusted annually. Income or investment returns might increase, or spending in other areas might be less than you anticipated. Then, you can contribute more to the grandkids if you want.

A good practice is to ask the parents how they’d like you to spend on the grandchildren. Let them know there’s a spending limit and that if you don’t adhere to it in a few years you’ll be asking them for support or even to live with them.

The parents might prefer you contribute to education funds instead of buying extra gifts on special occasions or treating the family to nice vacations together.

Spending on the grandchildren is one of those extra expenses that quickly can mushroom and grow out of control. Once you spend freely on the grandchildren, everyone will expect it to continue. Be sure it’s in your spending plan, that you adhere to the plan and everyone knows there’s a limit.