Drive 20 minutes outside of Panama City, past the Maersk shipping containers stacked by the railroad tracks, and you arrive at the Panama Canal. “I’ve heard the canal is actually smaller in person than you would imagine,” my best friend texted me from back home in New York. This is true. On a weekday morning last month, the sun streamed down on the lumpy hills beyond a barbed-wire fence, and a red-and-white oil tanker sat snug in a narrow channel of water, waiting for the century-old algae-covered doors of the Miraflores Locks to swing open and allow passage to the Atlantic. Six locomotive engines pulling cables attached to the ship – three on each side – rolled forward. Tourists crowded along the visitor center’s fifth-floor terrace and snapped photos as a voice on a loudspeaker spouted factoids about one of the most remarkable engineering feats in history.

Our team had come to Panama to interview Mossack Fonseca in person, and we were getting the lay of the land. I’d staked out an offshore investment conference taking place at our hotel, taken a spin through the historic district, and cruised along the bay on Avenida Balboa, where President Juan Carlos Varela lives in a high-rise apartment complex, next to the Intercontinental Hotel. The president selected Ramon Fonseca as one of his top advisers.

If you’re trying to get a handle on the bigger picture – what “offshore” even means, and why it’s problematic – Panama is as good a place to start as any.

Phrases like secrecy jurisdiction, tax haven and offshore have overlapping meanings, roughly translating as an “escape” from laws in one place to a locale whose allure is zero-to-low tax rates – along with tools to hide one’s identity, according to the Tax Justice Network. The network, an advocacy group that argues that tax havens have exacerbated global poverty and income inequality by giving the corrupt and the rich a place to stash assets, ranks Panama as No. 13 on its Financial Secrecy Index.

In March, right before my trip, the State Department released its annual report on money laundering threats, describing Panama’s lax regulations, dollar-based economy, and geographic location as an “attractive target,” particularly for drug traffickers with proceeds to clean. This past winter, following an FBI undercover bust, two men had pled guilty in U.S. federal court to conspiring to launder $2.6 million from a fraud scheme, using a private jet (the perfect vehicle to transport Luis Vuitton duffel bags stuffed with cash) and Panama bank accounts.

Of course, the U.S. had a big hand in shaping Panama’s destiny, stretching back to days when the canal was still a pipe dream, and even laid the groundwork for its financial system today. A circle of American financiers, chief among them J.P. Morgan, made $40 million off the canal deal, following a stealthy lobbying effort to get lawmakers to choose Panama over Nicaragua, according to author Ovidio Diaz-Espino’s critical history “How Wall Street Created a Nation.” At the time, the canal arrangement was the most expensive land deal of all time. Afterwards, Morgan and William Nelson Cromwell, the chief lobbyist for the financiers, managed Panama’s finances up until the 1930s. Cromwell, who co-founded the prominent law firm Sullivan & Cromwell, also became Panama’s de facto attorney General.

“Panama was largely a creation of the U.S.,” says Barney Warf, a University of Kansas geography professor who studies offshore banking.

Today, he says, “Panama is essentially an extension of the U.S. economy.” It harkens back to the early 20th century, when canal workers were paid in American dollars. In the roaring, free-market friendly 1920s, Panama adopted U.S.-style corporate laws. Some U.S. ships, seeking to avoid Prohibition restrictions against serving alcohol onboard, registered in Panama instead. Franklin D. Roosevelt’s administration was alarmed to find out that, as the U.S. worked to dig itself out of the Great Depression, wealthy Americans were using Panama as a tax haven.

Jurgen Mossack’s family landed here in the 1960s. During World War II, his father had served in the Nazi Party’s Waffen-SS, according to U.S. Army intelligence files obtained by the ICIJ. Once in Panama, the elder Mossack offered to spy on communists in Cuba for the CIA. (Mossack Fonseca said the firm “will not answer any questions related to private information regarding our company founding partners.”)

The move to Central America positioned Jurgen Mossack to ride the offshore banking wave that crested in Panama (and around the world) in the 1970s, when the country adopted bank-secrecy legislation designed to attract foreign money. Mossack earned a law degree at a private Catholic university, then completed an MBA in London. In 1977, back in Panama City, Mossack opened his own law firm, a two-person operation: just himself and an assistant. In 1986 he merged firms with Ramon Fonseca, who had studied at the London School of Economics and then spent six years working at the United Nations headquarters in Geneva.

From the start, the firm’s business involved clients with dark secrets, the ICIJ investigation shows. In 1983, six armed robbers looted $40 million in gold bars from the Brinks-Mat warehouse near London’s Heathrow Airport. Less than 18 months later, Mossack formed a Panamanian shell company for a man named Gordon Parry. Parry was convicted in 1992 of laundering money from the London heist, the second-biggest robbery in Britain’s history. But Mossack continued to do business with the company, despite realizing as early as 1986 that the company was “apparently involved in the management of money from the famous theft from Brink’s-Mat in London,” according to an internal memo. “The company itself has not been used illegally, but it could be that the company invested money through bank accounts and properties that was illegitimately sourced.”

Afterwards, the ICIJ investigation shows, the firm took steps that prevented British authorities from gaining control of the company. It wasn’t until 1995 that Mossack Fonseca ended its business relationship with the company.

A spokesman for Mossack Fonseca told the ICIJ that any allegations the firm helped shield the proceeds of the Brinks-Mat robbery are “entirely false.” Jurgen Mossack “never had any dealings” with Parry, and was never contacted by police about the case, the spokesman told ICIJ.

Many times Mossack Fonseca has had no clue which nefarious characters were doing what with the companies the firm created – as when Jurgen discovered in 2005, according to internal emails, that he was the registered agent and listed as the director for a company controlled by the Mexican drug lord Rafael Caro Quintero. The co-founder of the Guadalajara Cartel was convicted in Mexico in 1985 for the brutal murder of U.S. DEA agent Enrique “Kiki” Camarena. (Today, Quintero is again considered a fugitive by the US after walking out of prison in 2013 on a technicality).

Mossack Fonseca’s senior partners instructed an employee to carry out their resignation from the company upon the discovery. "Pablo Escobar was like a newborn compared to R. Caro Quintero!” Jurgen wrote in reaction to the news. “I wouldn't want to be among those he visits after he leaves prison!"