Some banks have to pay interest in advance. It is legal for banks to do so.
For the bank, you don't have to pay interest for the next five years, but the bank adopts the repayment method of equal principal and interest to prevent you from repaying in advance.