Barneys New York Inc. filed for bankruptcy protection with plans to close most of its stores and a new deal with a pair of investment firms that stepped forward at the 11th hour to throw a lifeline to the luxury retailer as it looks for a buyer.

The Barneys case took a detour Tuesday afternoon in bankruptcy court, when the company’s lawyer, Joshua Sussberg, said investment bank B. Riley Financial Inc. and Brigade Capital Management LP, a hedge fund that focuses on distressed debt, would provide the retailer a $218 million...