"Get ready to do some dancing," Quinn said. The colleague, managing director Steven Williams, replied: "What the heck. We'll all be retired when this . . . comes up on audit. Baby boomers have their fun and leave it to the kids to pay for it." In a congressional hearing this spring, US Senator Carl Levin blasted the email exchange and the profit-shifting strategy as exercises in the art of creating "unreality". An investigation led by Levin revealed that the accounting firm exploited legal loopholes to help Caterpillar shuffle $US8 billion ($9.3 billion) in paper profits from the United States to Switzerland, reducing the equipment maker's US tax bill by $US2.4 billion. The flare-up over the Swiss strategy that PwC orchestrated for Caterpillar is among the latest in a series of investigations and legal clashes that shine a light on the murky role that the world's four largest audit firms – PwC, KPMG, Ernst & Young and Deloitte – play in the offshore financial system. A review of court cases, government records and secret offshore files unearthed by the International Consortium of Investigative Journalists reveals that the big four firms are central architects of the offshore system – and key players in an array of cross-border transactions that raise legal and ethical questions.

In Luxembourg, internal company documents reviewed by ICIJ show, PwC helped Pepsi, IKEA and other corporate giants from around the world embrace inventive profit-shifting strategies that allowed them to collectively slash their tax bills by billions of dollars. In the US, authorities charged, KPMG peddled offshore tax shelters that created billions of dollars in fake losses for rich clients, then misled the Internal Revenue Service about how the shelters worked. In Dubai, anti-corruption advocates claim, EY's helped the Middle East's largest gold refiner obscure practices that may violate international standards aimed at combatting trafficking in "conflict gold", which comes from regions where competition for the mineral breeds bloodshed. In New York, authorities charged, Deloitte helped a British bank violate sanctions against Iran, submitting a "watered down" report to regulators that omitted information about how the bank might be evading money-laundering controls. "These firms are supposed to be built on honour and integrity and being a watchdog, but they're so big now it's all about making money," says Francine McKenna, an accountant who has worked for PwC and KMPG and now writes a blog, re: The Auditors, about big accounting firms' misbehaviour. "They're not worried about reputation, because all of this stuff has not affected their ability to get bigger and bigger and bigger."

Big four firms deny their practices are skewed by bottom-line considerations. EY told ICIJ that it "operates strictly within the law and has exhaustive controls" that ensure it follows legal and regulatory rules. KPMG and PwC said they had strict codes of conduct for everyone working under their banners worldwide. Deloitte didn't answer questions for this story but has laid out its views in various public statements. In cases when they've run into trouble, the big four have generally blamed rogue employees or said that their actions have been misunderstood or taken out of context. During April's Senate hearing on PwC's work for Caterpillar, for example, Quinn said he'd made "a very poor choice of words" in his email exchange with Williams, and Williams said he'd made an inappropriate "attempt at humour". A top PwC executive told Levin that the Swiss strategy designed by the firm was simply intended "to eliminate the unnecessary middleman". "We do not invent artificial business structures," the executive testified. GLOBAL CLOUT The big four are worldwide operations. Among them they employ more than 700,000 people and pull in revenues of more than $US100 billion a year, more than the annual economic output of Ecuador.

The accounting giants have their roots mostly in alliances formed in late 19th and early 20th centuries by US and UK accounting firms. Their continuing Anglo-American flavour and their global clout is a reflection of Wall Street and London's dominance within the world's financial system. The firms are structured as decentralised alliances of local partnerships in different countries, but much of their top leadership is based in the United ­States and Britain. Legal battles over the past decade have raised questions about whether governments see the major accounting firms, like major banks, as "too big to fail". This unwritten policy, anti-corruption campaigners say, has discouraged real reform at the big audit firms because they know authorities will only go so far in punishing bad behaviour. The big four have also gained clout and inside knowledge by helping governments write the laws that establish the offshore system's rules of engagement, and by lobbying heavily to keep the rules to their liking. Austin Mitchell, a member of the UK Parliament, has gone so far as to call the big four "more powerful than government". As the flow of money into tax havens has become an increasingly hot issue, financial transparency advocates fear the big audit firms will use their expertise and influence to undermine efforts to reform the offshore system. The firms have lobbied, for example, against proposals that would give national tax authorities more power to demand information on global corporations' activities around the world. Critics say big four accountants shuttle back and forth between the accounting industry and government so often in Europe and other regions that it undermines authorities' efforts to police the industry and enforce tax laws.

"You have got this revolving doors thing, where gamekeepers – if they are any good – get bought by poachers," UK House of Lords member Trevor Smith said during a parliamentary debate in 2013. OFFSHORE PLAYERS Big four partners are embedded throughout the offshore world. A 2011 study by the Financial Mailfound that between them the big four operate 81 offices in offshore havens. Deloitte, for example, employs roughly 150 people in the tiny English Channel islands of Jersey and Guernsey, two of the world's busiest offshore havens. Confidential documents obtained through ICIJ's Offshore Leaks investigation show that big four firms had a close relationship with Portcullis TrustNet, a Singapore-based offshore services firm that sets up hard-to-trace offshore companies for clients around the world. PwC, for example, helped incorporate more than 400 offshore entities through TrustNet for clients from mainland China, Hong Kong and Taiwan, the records show.

Another stash of confidential documents reviewed by ICIJ show that between 2002 and 2010 PwC helped hundreds of global companies obtain confidential tax deals from authorities in Luxembourg, allowing Amazon, Abbott Laboratories and others to book profits in the tiny European duchy and shrink their taxes at the expense of national treasuries around the world. The documents reveal, for example, that PwC helped three major Latin American banks use Luxembourg's accommodating tax regime to claim write-offs for "intangible assets" that allowed them to sidestep nearly €70 million ($102 million) in taxes between them in Brazil, an analysis by ICIJ's reporting partner, Brazilian daily Folha de S.Paulo, calculated. Luxembourg's tax deals are legal in Luxembourg, but may be subject to challenges by tax authorities in other countries who view them as allowing companies to avoid paying their fair share of taxes. US Tax Court cases show that big accounting firms are aware that the offshore profit-shifting and tax-savings arrangements they create can be at risk of being labelled illegal by courts or tax authorities. In one instance documented by a US Senate investigation, a senior KPMG professional urged the firm to ignore IRS rules on registering tax shelters. He "coldly calculated", a Senate report said, that the penalties for violating the law would be no greater than $US14,000 per $US100,000 in fees that KMPG would collect.

"For example," he wrote, "our average . . . deal would result in KPMG fees of $US360,000 with a maximum penalty exposure of only $US31,000." DEATH IN THE FAMILY Before there was a big four, there was a big five, a big six, even a big eight. Membership in the elite club began shrinking in the 1980s and 1990s as the mega-firms began swallowing each other through mergers. In 2002, Arthur Andersen, the largest of what was by then known as the big five, came under fire after investigators found evidence that high-level firm executives had ordered underlings to shred sensitive internal documents at Texas-based Enron, the energy and trading conglomerate that blew up amid reports of massive fraud. Andersen had been Enron's auditor as Enron had used offshore vehicles in the Channel Islands to hide its debts and book fake profits.

US authorities indicted the accounting firm on obstruction of justice charges. Private lawsuits also targeted Andersen's links to accounting frauds at Worldcom and other US companies. Many analysts concluded that rapid growth had changed a firm once known as a beacon of integrity. "Over time, greed corrupted Andersen," the Chicago Tribune said in an editorial. "Its leaders became more devoted to collecting hefty fees than keeping books straight." A jury convicted Andersen, ensuring the death of the 89-year-old firm. By the time the US Supreme Court threw out the conviction – ruling that the trial judge had improperly instructed jurors – it was too late. The firm was out of business. KPMG, Deloitte and EY bought up the remains of much of Andersen's American operations. The big five was now the big four. The legacy of Andersen's death would have ramifications that continue today. QUICK HITS For much of their lives, the biggest accounting firms operated with an aura of sobriety. They didn't solicit business. They waited for clients to come to them for help. By the turn of the new century, that had changed. Big four accountants were expected to be more than accountants. They had to be salesmen.

At KMPG, partners and other professionals were pressured to sell wealthy clients an alphabet soup of tax shelters with acronyms like FLIP, BLIPS, TEMPEST and OTHELLO. The shelters were designed to generate paper losses that would slash clients' tax bills. For example, OPIS – short for offshore portfolio investment strategy – relied on transactions routed through the Cayman Islands and other offshore locales. The effort had all the trappings of a mass marketing campaign usually associated with stock brokerages and other ventures that rely on aggressive sales pitches. KMPG had a call centre in Indiana stocked with telemarketers who cold-called prospective clients to try to sell them the firm's tax products. Internal emails trumpeted the firm's new "sales opportunity centre", invited partners to a meeting to "discuss our 'quick hit' strategies and targeting criteria" and talked up "tax minimisation opportunities for individuals" that would produce "a quick revenue hit for us". "We are dealing with ruthless execution – hand-to-hand combat – blocking and tackling," one executive explained to his colleagues. Employees were instructed to use sales psychology and "misleading statements" to pitch KPMG's products, according to a 2003 US Senate report. The firm distributed sales scripts that employees could use to bring around reluctant customers – suggesting a variety of mind games and bluffs, such as a "get-even approach" (pitching to clients just after the deadlines for tax payments to the government) and a "Beanie Baby approach" (playing on clients' fear of missing out on a big thing by pretending the firm would soon put a cap on its shelter sales).

KPMG's salesmanship won it thousands of clients and millions of dollars in fees. It also made it a target for the US Department of Justice. TOO BIG TO FAIL In June 2005, top KPMG executives and their lawyers met with a gaggle of prosecutors to discuss the Justice Department's criminal probe into the firm's tax shelter business. The government claimed KPMG had lied to the IRS about how its shelters were put together and that OPIS and other KPMG shelters were shams which used shell companies and bogus loans to generate at least $US11 billion in paper losses that cost the US Treasury $US2.5 billion. As the meeting began, a top prosecutor noted that the government hadn't ruled out filing criminal charges against the firm. But the discussion quickly turned to mutual agreement, according to a memo written by one of KPMG's lawyers. Neither the government nor KPMG wanted to see a criminal prosecution that might put the accounting firm out of business. What had happened to Arthur Andersen three years before was on everyone's minds. Robert Bennett, the powerful Washington lawyer who represented President Clinton during the Monica Lewinsky scandal, did most of the talking for KMPG. He said the firm understood it would have to pay "a lot" and suffer "a lot of pain". It could probably survive a tax fraud charge, but an obstruction charge "would kill us", Bennett said.

In the end, the government charged the company with a single count of tax fraud, then quickly dismissed the charge under a "deferred prosecution" agreement that allowed KPMG to put the criminal case behind it by paying $US456 million in penalties. The case made it clear, anti-corruption activists say, that a "too big to fail" philosophy discourages authorities from getting too tough with big audit firms. Similar questions arose in the Netherlands after KPMG partners were accused of helping a Dutch construction firm hide bribes used to help the builder win billions of dollars in contracts in Saudi Arabia. In December 2013, KPMG agreed to pay a settlement of almost $US10 million to head off criminal charges against the audit firm. Officials with KPMG's member firm in the Netherlands placed the blame on three partners who now face criminal prosecution, saying they were "shocked by the facts that have emerged from this case". Some legislators complained the case should have been taken into court so the public could learn the full story of the accounting firm's conduct.

"There is no word about the guilt of KPMG in this affair," Jan de Wit, a member of the Netherlands' Parliament, said. "It seems to be a cover-up." The Netherlands' justice ministry defended the deal, saying that the bribes and cover up had taken place many years ago, and that the KPMG had co-operated with prosecutors and taken steps to prevent similar problems. As a result of the case, KPMG officials say, they've put in new procedures that "focus on quality and integrity as absolute priorities". 'WHITEWASH' In recent years the big four have expanded their reach and revenues beyond corporate audits and tax shelters by marketing themselves as jack-of-all-trades watchdogs that can help companies discourage bribery and other misconduct. Through their consulting businesses, they act as anti-money-laundering experts, internal investigators and stand in for government as monitors in regulatory actions.

Early this year, an EY partner quit his job and went public with claims the firm had helped a gold refiner in Dubai downplay the buying and selling of "conflict gold". According to a report by the anti-corruption group Global Witness, records provided by the ex-partner indicated the firm had toned down an audit report submitted to Dubai regulators, cutting explicit findings that the refiner failed to report billions of dollars in suspect transactions. EY's member firm in Dubai said it had acted properly, telling ICIJ that it "refutes entirely the suggestion that we did anything but highly professional work" in the matter. All examples of rule violations by its client were reported to regulators, and there was no evidence that conflict gold moved through the client's refinery, the firm said. Two other big four firms have also been accused of softening reports to regulators, as a result of the work with banks doing business in New York. New York state regulators concluded that Deloitte helped UK-headquartered Standard Chartered cover its tracks by yielding to pressure from bank officials to keep quiet about suspect money transfers. A Deloitte partner explained in an email to a colleague that the transactions were "too politically sensitive" to include in a report to regulators. "That is why I drafted the watered-down version," he said.

Deloitte denied wrongdoing. It called the reference to a watered-down report "an unfortunate choice of words that was pulled out of context". US authorities eventually concluded Standard Chartered had hidden thousands of transactions totaling more than $US250 billion by banks controlled by the government of Iran, which is under US and international sanctions related to its nuclear program and support for terrorist groups. In 2013, New York's banking superintendent, Benjamin Lawsky, punished Deloitte for its role in the Standard Chartered affair by fining the firm $US10 million and suspending it for one year from doing consulting work for banks overseen by New York regulators. In August of this year, in a case involving questionable transfers of cash through the Bank of Tokyo-Mitsubishi UFJ, Lawsky hit PwC with a $US25 million penalty and a two-year suspension from taking consulting engagements with banks regulated by his agency. He said PwC had given in to pressure from the bank to "whitewash" a report to regulators. For example, Lawsky said, PwC deleted a section revealing the bank had used hashtags and other "special characters" to prevent automatic filters from flagging wire transfers involving sanctioned nations.

SUDAN, for instance, became SUD#AN. In a statement, PwC said its report "disclosed the relevant facts" and that the firm was "proud of its long history of contributing to the safety and soundness of the financial system". PAPER DRAGONS Questions about how far big four firms will go to help their clients avoid government oversight have also come up as they have pushed into a new market: China. China is emerging as an important mover in the offshore world, with most offshore professionals predicting it will become the greatest source of new business over the next five years, according a recent industry survey.

Over the past decade, the big four have gained a foothold in China by auditing Chinese firms that hope to sell shares in the US. In order to roll out a US public offering, Chinese businesses need the approval of the US Securities and Exchange Commission. The big four provided the gloss of respectability that Chinese executives needed to win over American regulators and investors. In many cases, the seal of approval from big accounting firms didn't mean the companies were safe bets for investors. In 2012, the Pittsburgh Tribune-Review found that dozens of Chinese companies peddling their shares in US have been accused of fraud by investors or the SEC. As the SEC began investigating suspect Chinese firms, the big four's member firms in China refused to turn over documents to the agency. The firms argue that if they provide documents to US law enforcers, they'll run afoul of Chinese corporate secrecy laws. It should be up to the US and Chinese governments to resolve the standoff, the firms say. "We're just piggy in the middle," the partner in charge of compliance for PwC in Greater China, told Reuters. In January, US Administrative Law Judge Cameron Elliot sided with the government, suspending the big four's Chinese units for six months from auditing US-regulated companies.

If the big accounting firms "found themselves between a rock and a hard place", the judge said in his ruling, it was "because they wanted to be there. A good faith effort to obey the law means a good faith effort to obey all law, not just the law one wishes to follow." Additional reporting by Stefan Candea and Fernando Rodrigues