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 that 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 under investigation 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.

Brazil's banking lobby group Febraban said in a note that of the 23 institutions mentioned in the investigation, only seven have authorization to grant payroll loans.

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.

State-owned lender Banco do Brasil said that "it has not issued payroll credit cards for four years and is available to authorities for further clarification."

Santander Brazil said it learned of the investigation through the media and that it was not contacted by authorities. It added that "all its products and services comply with regulation and that it is available to the competent bodies to provide clarifications."

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

Banco Pan said it is in contact with authorities to obtain official information and "reinforces its position of respect for customers and its commitment to combat fraud."

Bradesco declined comment, while Caixa did not respond to requests for comment. (Reporting by Paula Arend Laier and Aluisio Alves in Sao Paulo Editing by Cynthia Osterman and Matthew Lewis)