Royal Bank of Canada has agreed to hand over 40 years of records on hundreds of its clients revealed in the Panama Papers to federal tax auditors, in the first public step the government has taken to crack down on anyone named in the huge data leak.

The Canada Revenue Agency filed a motion Wednesday in Federal Court to get the bank to turn over the files, saying it wants to determine whether the RBC clients might have used offshore accounts and shell companies to evade tax.

"It is the experience of the CRA that Canadian taxpayers who hold … property through an offshore entity, or who may carry on business through an offshore entity, may not comply with their duties and obligations under the [Income Tax Act]," the court application says.

The CRA wants the names or any other identifying information on the RBC clients, as well as the names, directors, shareholders and other data on their offshore entities.

The tax agency is also asking for all RBC documentation on the due diligence checks it did on those accounts to determine who the real people behind them are.

The bank confirmed Thursday afternoon that it will comply with the demands, saying in a brief statement: "We respect the confidentiality of our clients within the bounds of the law, and we co-operate with all of our regulators."

429 offshore entities

The CRA court filing says its auditors learned of the accounts from CBC and the Toronto Star after they revealed last month, when news of the Panama Papers first broke, that RBC and its affiliates had set up or handled at least 370 offshore companies for clients through Panamanian law firm Mossack Fonseca since 1977.

Since those initial stories, CBC and the Star have found more than 50 other offshore companies, bringing the total to at least 429. About three-quarters of those were handled through an RBC arm in Jersey, an offshore haven in the Channel Islands; most of the companies were incorporated in the 1980s and '90s and are now defunct, but 45 are still active.

Mossack Fonseca, one of the world's top creators of shell companies, is the firm whose client files were blown open by the huge Panama Papers leak, exposing the offshore holdings of tens of thousands of people, including heads of state, athletes, movie stars and high-profile criminals.

Toronto tax lawyer and former federal prosecutor David Chodikoff said "it's prudent that the CRA is carrying out an investigation" into people named in the leak.

"As a result of the data dump, it is not surprising that the Canada Revenue Agency would seek to find out and obtain further information from those identified as having overseas accounts," he said.

The CRA also revealed Thursday it had independently started 40 audits related to Mossack Fonseca before the Panama Papers ever hit headlines. Commissioner Andrew Treusch told the House of Commons finance committee his staff have "tens of thousands of records from multiple sources" to go over.

'Concerned about our brand'

It is not illegal to have an offshore account, but any income must be reported for tax purposes, as well as any offshore assets totalling more than $100,000. Offshore jurisdictions like the Cayman Islands, British Virgin Islands, Isle of Man or Liechtenstein often have strict confidentiality rules for bank accounts and shell companies that make it easier to hide assets from tax authorities.

After it emerged last month that RBC's name was in the Panama Papers hundreds of times, CEO David McKay told shareholders the bank would comb through its records to determine exactly what ties it might have had with Mossack Fonseca.

McKay said he was "concerned about our brand and reputation" after the bank's name had been "dragged into" the controversy, especially considering that there was no evidence to suggest the company had done anything illicit.

"We just happen to have a couple hundred files, going back 40 years, that are attached to this legal firm," he said at RBC's annual general meeting. "That's all that's been reported."

This is not the first time the Canada Revenue Agency has gone to court to get Royal Bank to hand over information on clients with offshore holdings. In 2008, the tax authority obtained an order forcing the company's brokerage unit, RBC Dominion Securities, to provide names and details on people with stock-trading accounts based out of Liechtenstein that the CRA alleged were being used to disguise income.

Contact the writer of this story at zach.dubinsky@cbc.ca