SAO PAULO, Aug 25 (Reuters) - Brazil's government on Thursday announced it will investigate 23 financial institutions, including the country's top banks, for allegedly issuing unsolicited credit cards when customers signed up for payroll loans and charging them undisclosed fees.

The Justice and Public Security Ministry said in a statement lenders provided customers with credit cards without prior notice when they signed up for such loans, which are repaid through automatic deductions from the borrower's paycheck.

The investigation follows complaints from a consumer protection agency in Rio de Janeiro state, it added, saying payroll loan withdrawals were allegedly charged through the unsolicited credit cards.

Among those being investigated are Banco Bradesco SA , Itau Unibanco Holding SA's Itaucard, Banco Pan SA, Nubank, Banco Santander Brasil SA and state-controlled lenders Banco do Brasil SA and Caixa Economica Federal.

Itau said in a statement to Reuters it does not operate credit cards through payroll-linked loans and that it would provide any additional clarification requested by Brazil's Justice and Public Security Ministry.

Nubank also denied offering such product, adding it is not cleared to do so.

Bradesco declined comment, while Banco do Brasil, Banco Pan, Santander Brasil and Caixa did not immediately respond to requests for comment. (Reporting by Paula Arend Laier; Editing by Cynthia Osterman)