The U.S. Supreme Court agreed to decide whether thousands of borrowers can invoke a federal debt-collection law when they are facing foreclosure.

The justices said they will hear an appeal from a Colorado man who defaulted on a $330,000 home loan in 2009 and is now battling a law firm that sought foreclosure on behalf of lender Wells Fargo & Co.

The issue is whether the Fair Debt Collection Practices Act, which protects borrowers, applies in foreclosure proceedings that take place outside the court system. Lower courts are divided on the question.