MEXICO CITY — The two men came together in an era of political and economic uncertainty in Panama: One a reserved German immigrant whose father served in the armed wing of the Nazi party, the other a gregarious, aspiring novelist whose family opposed Panama’s military dictatorship.

With the nation still under the sway of Gen. Manuel Noriega, the pair merged their small law firms in 1986, creating what would become a powerhouse of secretive offshore banking for the elite. Over the next three decades, Jürgen Mossack and Ramón Fonseca expanded their practice to a staff of 500, with affiliate companies around the world and a client list of the powerful, the famous and, sometimes, the infamous.

In January, a prosecutor investigating the sweeping corruption in Brazil publicly called their law firm “a huge money launderer.”

The partners had become very wealthy, and Mr. Fonseca leveraged the firm’s success to gain an influential role in the upper ranks of politics. He told associates that he wanted to clean up the government, serving as a special adviser to President Juan Carlos Varela until the corruption scandal in Brazil forced Mr. Fonseca to resign this year.