CarMax (KMX) on Thursday announced it suffered massive losses in the second quarter, failing to meet Wall Street expectations.

The Richmond, Virginia-based used car dealer was hit by high inflation and soaring interest rates, which have hurt its competitors and markets across industries.

"Consumer confidence, certainly during the quarter, [was at an] all-time low as far as recent history ... even lower than the height of the pandemic. So I just think consumers are prioritizing their spending a little differently," Chief Executive Bill Nash told analysts in a conference call.

The company reported gross profits of $737 million, down 9.6% from last year. CarMax said its retail sales declined 6.4% in the latest quarter, while unit sales fell 15%. The company also said its wholesale vehicle margin fell 26% from last year.

Nash said CarMax was still able to grow its market share. "We remain on track to achieve our long-term strategy and goals," he said.

With consumer demands shrinking, the company said it has prioritized smaller, more budget-friendly vehicles to cater to the market.

Shares of CarMax plunged on Thursday, closing at $65.16, down $21.26, or 24.6%. It was the largest one-day drop in 22 years.

Shares of auto retailer Carvana and automakers Ford and General Motors also saw sharp declines.