These days, Wells Fargo & Co. and Citigroup Inc. are unlikely to make a $14,000 auto loan to a borrower with a subprime credit score. That is now the domain of direct lenders such as Exeter Finance LLC, based in Irving, Texas.

But where does Exeter get the money to make subprime auto loans? From Wells Fargo and Citigroup. They have helped lend Exeter $1.4 billion for that very purpose.

Bank loans to Exeter and other nonbank financial firms have increased sixfold between 2010 and 2017 to a record high of nearly $345 billion, according to a Wall Street Journal analysis of regulatory filings. They are now one of the largest categories of bank loans to companies.

Banks say their new approach of lending to the nonbank lenders is safer than dealing directly with consumers with bad credit and companies with shaky balance sheets. Yet the relationships mean that banks are still deeply intertwined with the riskier loans they say they swore off after the financial crisis.

Loans to nonbank lenders got several banks into trouble during the crisis. Montgomery, Ala.-based Colonial Bank, for instance, became one of the largest bank failures of the era after a nonbank mortgage lender misappropriated more than $1.4 billion from its credit facility with the bank, according to the Justice Department.