What is the correct way to pay out an escrow account when a borrower terminates a mortgage loan? Is it taken off of the loan principal or is it refunded directly to the borrower?

We believe that, until January 2014, at the termination of a mortgage loan, the remaining escrow account must be refunded directly to the borrower (unless the total amount of surplus is less than $50, in which case the amount may be applied to the loan principal). 12 CFR 1024.17. The Department of Housing and Urban Development (HUD)’s RESPA rules require servicers to perform an escrow account analysis within 60 days after a loan is paid off. 12 CFR 1024.17(i)(4)(iii). If you discover a surplus in the escrow account, within thirty days you must “refund the surplus to the borrower if the surplus is greater than or equal to 50 dollars ($50). If the surplus is less than $50, the servicer may refund such amount to the borrower, or credit such amount against the next year’s escrow payments.” 12 CFR 1024.17(f)(2).

Note that when the CFPB’s new RESPA regulations go into effect, on January 10, 2014, this rule will no longer apply. The CFPB’s final RESPA rules require servicers to refund any escrow account surplus within twenty days after a loan is paid off. If the borrower is refinancing the mortgage loan with a lender that was the lender, owner, or servicer on the previous loan, then the servicer has the option of crediting the escrow surplus into a new escrow account. See new Section 1024.34. The official staff commentary notes that nothing in this section is designed to forbid an institution from refunding the balance directly to the borrower or applying the amount against the loan balance. Comment (b)(1) and Comment (b)(2)(1).

https://www.federalregister.gov/articles/2013/02/14/2013-01248/mortgage-servicing-rules-under-the-real-estate-settlement-procedures-act-regulation-x#h-329