(Bloomberg) -- There’s a big upside to record used-car prices: Auto lenders like GM Financial are cashing in.

General Motors Co.’s lending unit booked a $2 billion gain last year reselling the vehicles that came back from expired leases and anything the company repossessed, according to a regulatory filing Wednesday. That helped GM Financial to nearly double its annual profit to $5 billion, allowing it to pay a $3.5 billion dividend back to the automaker.

Shares in GM rose 2.4% in early trading in New York after the company detailed financial results late Tuesday, including record profit, and said that the semiconductor shortage is beginning to ease up. The stock fell 7.8% this year through Tuesday’s close, worse than the 4.6% decline in the S&P 500 index.

Read more: GM sees high costs, shift to budget cars capping profit

The used-car boom won’t last forever, GM said. The company expects prices to come down a bit, which will lower GM Financial’s profit for 2022 to between $3.5 billion to $4 billion, GM Chief Financial Officer Paul Jacobson said on a call with analysts. That’s still a big benefit considering GM expects to make $13 billion to $15 billion in earnings before interest and taxes this year.

©2022 Bloomberg L.P.