It might sound like a line from a book by Dr. Seuss, but “Can I legally sell my house to my spouse?” is a legitimate question. It comes up particularly in the cases of divorce—before the deal is done, of course. Selling the home to one spouse is one way for couples to divide their assets as they split up. But there are also other instances when it can be a good idea.

Is selling your house to your spouse legal?

“The quick answer for this question is yes, it is legal to sell your home to your own spouse,” says real estate agent Fernando Morais of Triplemint in New York City. Often in a divorce, one party is instructed by the court to buy the other out.

Tax implications

That said, there are a few things to be aware of before you sell your house to your spouse. Morais recommends consulting an accountant to see if the sale is likely to result in a hefty tax bill.

The laws on selling your house to your spouse vary from state to state and may also differ depending on whose name is on the mortgage, says Dale Weir, a Realtor® with Coldwell Banker in Chesterfield, MO. He recommends talking with a local real estate lawyer to find out what the laws are in your state.