Is it illegal for the mortgage company to sell the mortgage car and drive it back?

Legal analysis: those who violate the law belong to unauthorized possession and should be returned to the buyer. The mortgage contract was established when the contract came into effect to guarantee the performance of the debt. Moreover, the other party is the owner of the vehicle and has the right to sell the vehicle. It's just that the other party violates the mortgage contract and needs to bear the liability for breach of contract. The mortgagor may require the other party to pay off debts in advance or provide other guarantees.

Legal basis: Civil Code of People's Republic of China (PRC).

Article 577 Where a party fails to perform its contractual obligations or fails to perform its contractual obligations in conformity with the contract, it shall be liable for breach of contract such as continuing to perform, taking remedial measures or compensating for losses.

Article 394 Where the debtor or a third party mortgages the property to the creditor to guarantee the performance of the debt without transferring the property, and the debtor fails to perform the due debt or realize the mortgage right according to the agreement of the parties, the creditor has the right to be paid in priority for the property. The debtor or the third party specified in the preceding paragraph is the mortgagor, the creditor is the mortgagee, and the property that provides guarantee is the mortgaged property.