Why are banks called debtors as well as creditors?

Debtor is a person who owe§ some amount of
money to a person and creditor is a person who has to collect money from a person or to whom a person owes money.
A bank owes money to its depositors that is why it is called debtor. On the other hand, a bank grants loan also and all those who have taken loan owe money to banks. That is why a bank is also called creditor. A bank is a debtor for its depositors and creditor for its loan holders.