Locked up in a Brazilian prison, accused of bribery in one of the country’s biggest corruption scandals, Joao Procopio saw one way out.

He struck a deal with prosecutors. In return for his release last year, Procopio spilled the beans on how he’d moved almost $30m in kickbacks offshore.

Swiss bank accounts and loose tax rules in a number of countries had allowed him to hide the money trail.

One of those countries was New Zealand – Procopio set up a limited partnership company called Santa Tereza Services, registered to an Auckland address.

The firm was part of an intricate structure of offshore companies now implicated in a huge Brazilian bribery scandal – known as Operation Car Wash - and a controversial bid to redevelop an African port.

Procopio worked for a fixer and currency dealer called Alberto Youseff, who is also accused of helping construction company Construtora OAS funnel bribes through offshore accounts.

Their office in Sao Paulo was raided by police in 2014. A huge tranche of incriminating documents – including Swiss bank account statements – revealed the link to Santa Tereza Services.

Leaked documents from Panama law firm Mossack Fonseca appear to detail one such deal. In 2013, Santa Tereza was used to make two unexplained payments related to a bid to win the $400m contract to redevelop Walvis Bay port in Namibia.

OAS was competing for the contract. The money – one payment of US$1 million, and another of $50,000 - went through a Panama company, registered to former Trinidad and Tobago politician Ken Emrith.

Emrith also worked for OAS in the Caribbean.

The payment was supposed to be for a technical study which would determine the price of the port development.

But Santa Tereza’s transactions were raising eyebrows.

Procopio had employed another New Zealand company - trustee.net.nz - to form Santa Tereza Services and a UK parent firm called Santa Clara Equity. Procopio told them that he wanted to build a hotel for the Olympics in Rio de Janeiro.

Bruce Sheppard – a well-known accountant and champion of cleaning up board rooms – was a director and shareholder of Trustee.net.nz.

Sheppard says that after a while Procopio was slow to provide financial statements and in 2013 they became concerned about “transactions within the bank accounts that were not in line with what he undertook these structures would be used for”.

Trustee.net.nz raised the alarm with authorities but anti-money laundering laws mean we can’t say how.

Meanwhile, Emrith’s bank was also worried about the payments.

The Bank of St Lucia International (BOSLIL) unexpectedly closed his account and refused to allow the first transaction in August 2013.

The Panama Papers show Mossack Fonseca’s New Zealand agent, Daniel Leon, desperately advocating on Emrith’s behalf.

Emails went back and forth between the bank’s compliance department and Mossack Fonseca.

BOSLIL wanted to ascertain what the company was doing and get an explanation for the cash. Emrirth – through Mossack Fonseca – supplied a technical study on the Namibian port to the bank and a contract with Santa Tereza and was eventually paid in late 2013.

In the end, the Namibian government rejected the bid by OAS.

Emrith didn’t respond to our requests for comment.

Mr Sheppard says Procopio presented as a plausible client – and his company went to extra lengths to prove Procopio was legitimate.

He says Procopio was introduced to his UK-based partner by “an international banker of repute” and a Brazilian barrister vouched for the businessman.

“Initial inquiries in the Brazilian economy indicated this man to be well-qualified, wealthy in this retirement years, holding public company directorships, in short a respected business person.”

Sheppard’s partner even went to Brazil to meet Procopio. “And of course we cited all of the identification documentation that was required under the anti-money laundering [regulations].”

He says trustee.net.nz is “not a shareholder or a manager…we had no involvement in any of the transactions of the structure. It is like a lawyer forming a company.”

The firm’s staff chased Procopio to comply with regulations, Sheppard says.

“It is very difficult when you have someone who looks respectable at the front end of the business, who is making the right noises about doing proper and decent business, that then suddenly goes quiet.”

Mr Sheppard said trustee.net.nz was formed to help ex-pat Kiwis returning to New Zealand. “But what we also found is that these structures are a cowpat – they attract flies.”

He says the New Zealand regime can still work – if there are tighter disclosure rules. “In New Zealand, these entities have complete secrecy and sunlight is the best disinfectant.”

Government ministers will receive a report on foreign trusts tomorrow, and are expected to tighten up disclosure rules.

Santa Tereza Services was deregistered in July last year. A spokesman for the Ministry of Business, Innovation and Employment said it did not comply with rules that require a general partner to live in New Zealand.

“Neither the Registrar nor MBIE had any knowledge of the activities of Santa Tereza and, therefore, no investigation was undertaken,” he said.

IRD refused to say if it was investigating Santa Tereza Services or trustee.net.nz.

A spokesman cited privacy reasons. “These types of questions all fall under the taxpayer secrecy provisions in the legislation we operate under, so we’re unable to comment.”

The Police's Financial Intelligence Unit said it is "currently gathering information around all matters that relate to New Zealand that have been released into the public domain by the International Consortium of Investigative Journalists.

"This information will be assessed to determine what, if any, relevance there may be from a Police perspective. Police will liaise as appropriate with other agencies such as IRD as part of this process."