Lenders will initiate foreclosure proceedings when borrowers become delinquent in their mortgage obligations, usually after three payments are missed. The lender will then notify the borrower in writing that he or she is in default. The lender can request a trustee's sale or a judicial foreclosure, in which the property is sold at public auction. A borrower can cure the default by paying the overdue amount and the pending payment after the notice of default is recorded, usually no later than a few days before the property's sale. Some sales allow the successful bidder to take possession of the property immediately. If the former owner refuses to vacate the premises, the court can issue an unlawful detainer that allows the sheriff to come out and evict them. Borrowers should do everything they can to avoid foreclosure, which is one of the most damaging events that can occur in an individual's credit history.