At the end of the tenancy, under normal circumstances a landlord is legally required to return a security deposit plus one percent interest or provide the tenant with a written, itemized explanation as to why the deposit will not be returned. A landlord must do so within twenty-one (21) days after the end of the tenancy, unless other conditions apply. If your landlord wrongfully withholds any portion of your security deposit, you can sue him for its return. If you are successful, you may receive the deposit amount due, the interest, and an additional civil penalty up to the amount withheld. If withheld in bad faith, you may also receive a $500 punitive fee. You are not allowed to use your security deposit to pay the rent. For example, you are not allowed to skip paying your last months rent and instruct the landlord to use your security deposit towards rent. If you do this, your landlord may sue you and recover rent for the last month plus a penalty.

https://www.revisor.mn.gov/statutes/?id=504b.178