First, let us clarify that the mortgage is the guarantee which allows a bank to cover itself in the event that the borrower is no longer able to repay his loan. In fact, the borrower could not sell the property without obtaining approval and the release of the mortgage.
The bank has the right to cancel the credit in the event of non-payment, to have the property sold during legal proceedings and to recover the balance of its debt from the proceeds of the construction of the building.
On the other hand, in the event of early repayment of your mortgage loan, the notary is required to request the release of the mortgage. Release is a legal act where the bank certifies that the borrower has fully repaid their loan.
This release is done by notarial deed which therefore generates notary fees. In practice: the release of a mortgage is only essential if you decide to sell the building. Otherwise, just let time pass to get the 30-year period to expire. In this case the mortgage will disappear automatically but this time without any costs.