The payoff happens at closing
When your home sells, the title company sends the payoff amount to your lender from the closing funds. Your lender then releases the lien on the property, and the buyer gets a clear title.
You ask your lender for a payoff statement before closing. It shows the remaining balance plus interest through the closing date. The number moves a little each day, so the statement carries a good-through date.
The sale can close only when the payoff, the closing costs, and any other amounts owed against the home are covered by the sale price, or by funds you bring to closing.
The offer-to-closing stage is where the payoff happens. Katy's guide to how long it takes to sell a house in Minnesota covers each stage of a sale and where the time goes.
