The closer you are to retirement, the more crucial it is to get it right.

For older couples who decide to split up, divorce can look very different than it might have in their younger years. Children often are grown and out of the house, so child support and custody aren’t an issue. And breakups after long marriages can sometimes seem amicable rather than contentious; partners simply grow apart and decide to go their separate ways.

SPONSORED CONTENT FROM COMPARE CARDS: 4 Travel Credit Cards With First Class Sign-Up Bonuses

But with gray divorce on the rise—the divorce rate for adults over 50 has doubled since the 1990s, according to the Pew Research Center—both partners need to understand how to correctly split up retirement plans and other assets.

One partner may offer to be generous, but that’s not necessarily helpful. You need to follow specific rules for dividing 401(k) plans and IRAs, or one partner could take an unnecessary financial hit or face an unexpected tax bill.

And the closer you are to retirement, the more crucial it is to get it right. “You can’t afford to make mistakes,” says Diane Pappas, a divorce financial analyst and owner of Solutions for Divorce, in Boston.

High-earning older couples also may have more complicated financial situations than younger couples, with both partners sometimes owning multiple 401(k)s, pensions and IRAs, making it hard to split everything equitably.

And increasingly, divorcing clients own annuities, which are challenging to divide, says Jeff Kostis, president of JK Financial Planning, in Chicago, and a divorce financial planner. Every annuity contract can be different, and in some cases, couples may need to trade off other assets to avoid cashing out an annuity and losing much of its value.

If you’re facing a gray divorce, start by accepting that regardless of what agreement gets hammered out with your estranged spouse, your finances are going to take a hit, Pappas says. Be realistic: You had one household, with a set amount of income. You’re splitting that into two households, on the same amount of income. “Something has to give,” she says.

You’ll also need to accept that retirement plans are among the assets you’ll need to divide. Partners who hold retirement plans don’t always understand this, says Peggy Tracy, owner of Priority Planning, a tax preparation and financial services practice, in Wheaton, Ill.

“They’re shocked they have to share it,” she says. “They feel they are entitled to all the money.” She has to explain that yearly contributions to a 401(k), for example, came from a couple’s mutual income, and a partner is entitled to a share.

Divide a Plan

Some couples are tempted to simply split plans themselves. Or at the end of a long mediation session, with retirement plans last on the list, a couple may simply agree to a 50-50 split. But it’s not that clear cut.

For both 401(k) plans and pensions, you’ll need a qualified domestic relations order, which is a judicial decree recognizing a divorcing spouse’s right to receive all or a portion of the account owner’s qualified plan, says Colleen Carcone, a director of wealth planning strategies at TIAA, in Boston. The QDRO is submitted to the plan administrator. A portion of the plan can then be transferred to the divorcing spouse’s name.

When you split a 401(k) plan with a QDRO, you get a one-time divorce-related break. If you take some of the cash out, perhaps for a down payment on a house, you will owe taxes on the distribution but not the 10% penalty for taking an early withdrawal under age 59½. If you roll the money immediately into your own newly established IRA, you won’t owe taxes or a penalty.

Before splitting a 401(k), be sure to check a partner’s paystub to ensure he or she doesn’t have an outstanding loan that’s being repaid through paycheck deductions, Tracy says. And change your beneficiaries, if you don’t want your ex-spouse named for your plan.

For employer pensions, be aware that each employer has different rules on how or whether the pension can be split, Tracy says. Plus, you’ll need a professional to determine its value before you can divide it, a process that can take two or three months. Until you have that information, don’t set terms for splitting the pension, she says.

QDROs don’t apply to IRAs. Division of IRAs should be detailed in a divorce decree or separation agreement. The agreement then has to be submitted to the IRA custodian. “You just can’t sign a napkin over drinks,” says Dave Stolz, a certified public accountant and financial planner, in Tacoma, Wash.

Understand the tax rules for splitting an IRA to avoid unexpected penalties. You can’t take a one-time penalty-free distribution from an IRA because of a divorce, Pappas says. Take some cash out and you will owe taxes on the distribution, plus the 10% early-withdrawal penalty if you’re under 59½. But if the money is rolled directly to an IRA, there is no penalty or tax.

All retirement plans aren’t equal. A partner receiving traditional 401(k) assets will owe taxes on any distributions, so it’s not equivalent to getting the same dollar amount of Roth IRA assets. Roth IRAs are funded with after-tax contributions. Planners usually separate Roth IRAs from other retirement assets and split them in half, says Tracy.

If your finances are especially complicated, you might consider a collaborative divorce. Each partner typically hires his or her own attorney, but they jointly use a financial planner and coach.

The goal is to divide the finances to best meet each partner’s goals, Kostis says. Sometimes that may mean unequal divisions of individual assets such as 401(k) accounts or cash accounts, so one person has a more secure retirement and the other has cash to purchase a house.

For example, Social Security benefits can’t be included as a marital asset, by law, and the actual benefit can’t be divided. A higher-earning spouse will have a bigger benefit than a spouse who may have worked part-time to care for children.

The higher earner might agree to provide monthly support payments for a certain period of time to make up the difference, Kostis says. Or the couple might choose to trade off other assets, perhaps from an investment account. “You set your own rules,” Kostis says.