SAO PAULO/MEXICO CITY, Aug 1 (Reuters) - Brazilian retailer Americanas' management received several notices of accounting deficiencies and inadequate internal controls, a partner at accounting firm KPMG said on Tuesday, issues at the heart of fraud that became public this year.

Americanas, which filed for bankruptcy protection in January and has accounting irregularities of more than $5 billion, was aware of the deficiencies and canceled its contract with KPMG after the accounting firm sent it an internal control letter in 2019, KPMG partner in Brazil Carla Belangero said.

Belangero testified before Brazilian lawmakers on Tuesday as part of a federal investigation into the scandal, which has rocked one of the South American nation's top retailers.

A mid-June report, prepared by an independent company committee and published by Americanas' current management, slammed former executives, while raising questions about banks' and audit firms' involvement in "fraudulent" and "altered" financial statements.

Belangero said that KPMG, which also handled accounting for Lojas Americanas and B2W before they merged in 2021, did not find fraud at either company from 2016 to 2019.

However, KPMG did find "deficiencies" in their control over a cooperative advertising budget, or when manufacturers and retailers share advertising costs, Belangero said.

The firm flagged needed accounting improvements, including in the cooperative advertising budget, to Lojas Americanas' and B2W's finance chiefs in August 2019, Belangero said.

"Since we didn't receive a response, we decided to issue an internal control letter to get management's attention," she added.

Six days later, Americanas terminated its contract with KPMG, Belangero said. The company cited "business circumstances" as the reason.

Fabio Cajazeira Mendes of accounting firm PwC told lawmakers that such fraud, if proven, would have been sophisticated, meaning auditors may not have found irregularities at the time.

"There is unfortunately the possibility that this fraud would have gone undetected," Mendes added.

Ex-executive Miguel Gutierrez was also expected to testify on Tuesday but did not attend, citing health issues.

Ex-financial head Fabio Abrate attended the testimony but refused to respond to lawmakers. (Reporting by Carolina Pulice and Andre Romani; Editing by Cynthia Osterman)