LoanDepot Inc. has withdrawn its initial public offering.

The Foothill Ranch-based mortgage lender earlier this month set the terms for the IPO that valued the company at about $2.5 billion.

It had been planning to sell up to 34.5 million shares of common stock at between $16 and $18 each, to raise as much as $621 million and net about $450 million.

"LoanDepot withdrew from pursuing an IPO at this time due to market conditions," a spokesperson said.

The offering would have been among the biggest in years involving an Orange County-based company.

LoanDepot was founded in 2010 by Anthony Hsieh and has grown to be among the nation's biggest consumer-direct nonbank mortgage lenders.