When Michael Brandner, a plastic surgeon in Anchorage, packed his bags and drove more than 4,000 miles from Washington state to Costa Rica in 2007, he wasn't just getting away from it all. Not long before, Brandner's wife of 28 years had filed for a divorce. According to a later indictment and court documents, the doctor "collected" US$3 million of his and his wife's assets, converted them into cashier's checks and set off on a secret trip.

In Costa Rica, Brandner opened a bank account to deposit some of the money and put a thousand ounces of gold in a safety deposit box. Then he travelled to Panama, where he opened an account in the name of a sham organisation, Dakota Investment, according to prosecutors' documents from the case. In 2008, he deposited US$4.6 million into the account. Brandner also did not report the accounts to the Internal Revenue Service. During the divorce proceedings, Brandner claimed the money was tied up in these investments and could not be returned, and that the investments were then lost.

Brandner went to all this trouble, the Justice Department says, to conceal assets from his wife, who could have been awarded some of them. Ultimately, US investigators seized the assets. The doctor pleaded not guilty to the charges, but on April 4 of this year, he was sentenced to 48 months in prison for wire fraud and tax evasion.

Brandner's case draws attention to a less widely recognised use of offshore accounts – hiding assets from a spouse in divorce – that was highlighted by the leak this month of the Panama Papers, which contain many details about the secretive offshore companies and accounts of public officials, drug kingpins and money launderers. The Washington Post has not reviewed the 11.5 million documents.

Brandner declined to be interviewed directly, but his lawyer, Randall Ensminger, offered several defences. He says that Brandner did not evade taxes on purpose – he just didn't know that he needed to file for the offshore accounts – and that he took the money to Panama not to defraud his wife but to protect their assets during a time of emotional upheaval in their relationship. Brandner's intent in taking the money to Panama was "to protect it on behalf of his heirs," says Ensminger.

Brandner is appealing the conviction, in part because his lawyer, Ensminger, fell sick during the trial, and the judge required Brandner to get a different lawyer to proceed. Brandner now argues that this infringed his Sixth Amendment rights to a fair trial.

While Brandner's name wasn't in the Panama Papers, reporting by the International Consortium of Investigative Journalists suggests the leaked documents also contain stories of scandals that are more personal in nature. Offshore companies are not just used to hide wealth from tax authorities; they also are a vehicle for wealthy spouses to try to hide their assets in divorce proceedings.

Experts in the industry say that Americans are still hiding money offshore from litigious spouses and tax officials alike, but it is getting harder for them to do so. In the last few years, the Obama administration and the Treasury department have erected staggering penalties for those who hide their wealth offshore, as well as many new reporting requirements, says Daniel Jones, a forensic accountant who specialises in the issue.

To cut down on white-collar crime, the United States and other countries have also been sharing more financial information in recent years. In 2010, the United States passed the Foreign Account Tax Compliance Act, which allows the US to freeze accounts for foreign entities that don't hand over information on the foreign accounts of US taxpayers.

"The US government has very severe penalties for people who hide money in other countries and don't pay US taxes on it, and the government has been very aggressive in investigating and prosecuting people who don't report income from foreign accounts," says Sanford K. Ain, a family lawyer in D.C. who has worked on divorce cases involving offshore accounts.

Mossack Fonseca, the Panamanian law firm at the centre of the Panama Papers leak, appears to have at least considered helping clients try to hide their assets from spouses who might be awarded them in a divorce.

In one email, which was put online by ICIJ's parent organisation, a Mossack Fonseca employee discusses the case of a Dutch man who wants to "protect part of his assets against the unpleasant results" of a divorce on the horizon. "Would it be possible or even recommended to use a vintage foundation in order to avoid access of the ex-wife as creditor?" the Mossack Fonseca employee writes.

In a statement to ICIJ, Mossack Fonseca said it was not involved in the management or operations of its clients' companies. "We regret any misuse of companies that we incorporate or the services we provide and take steps wherever possible to uncover and stop such use," the firm said.

The Mossack Fonseca leaks contained other details on high-profile divorces – for example, that between Dmitry Rybolovleva, one of Russia's richest men, and his wife Elena. According to reporting by ICIJ, the Panama Papers show that Dmitry Rybolovleva used Mossack Fonseca to incorporate an offshore company named Xitrans Finance Ltd. in the British Virgin Islands.

As their marriage was coming to an end, Dmitry used the company to move paintings and antique furniture out of Switzerland to Singapore and London, beyond his wife's reach, ICIJ reports, citing notes from a court hearing sent via email to Mossack Fonseca. In court, Elena's attorney claimed that the husband had used tax havens to hide the $650 million worth of artworks.

Dmitry and Elena Rybolovleva both declined to comment, ICIJ says.

The story of Brandner illustrates some of the advantages and pitfalls of secretive offshore companies. For decades, the benefit of opening an account in Panama, a notorious offshore haven, was its strict bank secrecy laws.

But Brandner's plan ran into a few problems. According to the court documents, the person in Panama who helped him open the Dakota account later became a federal witness, cooperating with a separate US investigation of a stock fraud scheme. Then, in 2010, the US and Panama signed a tax treaty, which gave US investigators new access to information from Panamanian accounts.

The witness used this tax treaty as a way to persuade Brandner to transfer money back to the United States, where it could be seized by federal authorities, say both Ensminger and Assistant US Attorney Bryan Schroder, a prosecutor for the case.

A company called Evergreen Capital LLC was set up in Wyoming in an attempt to secretly repatriate the Panamanian funds, the indictment says. Brandner then opened a bank account for the company at a Bank of America branch in Washington state, and transferred all the Panamanian funds to the US account, according to court documents.

It was at this point that federal agents seized the money – a total of US$4.66 million.

The money remains in the government's possession, though Brandner has an appeal pending to get back his portion of it, says his lawyer Ensminger.

"This case demonstrates that there is no longer any country where it is safe for a defendant like Dr Brandner to hide money from the government," Caroline Ciraolo, an acting assistant attorney general in the Justice Department, said about Brandner's conviction.

There are reasons – beyond the government's oversight – that it's becoming more difficult to hide assets overseas.

In the old days, a spouse who was suspicious that their partner was hiding assets from them would hire a private investigator to follow the spouse, in hopes of turning up information, lawyers say. But now, funds are transferred electronically and many clients never set foot in the offshore jurisdiction where they have their accounts. So today, most lawyers wait for the court to order "discovery," a process in which both parties exchange information pertinent to the case, and then look for instances where assets have mysteriously disappeared.

"You have to trace the assets, trace the liabilities, and when they all of a sudden seem to disappear in thin air, that's really not feasible," says Jones.

The problem with most of these divorce cases is that it can take a fantastic amount of time and money to uncover offshore accounts – meaning the effort is often only worth it for very wealthy people.

Martin Kenney, a lawyer in the British Virgin Islands who specialises in fraud and asset recovery, says that the scope of some divorce cases can be much larger than federal tax investigations, because they are trying to map the wealth of some of the world's richest people.

The spouses that his firm investigates sometimes have sprawling business empires that have sought out complex, secretive corporate structures for other business reasons, including for tax efficiency or to form joint ventures. For big cases, Kelley's firm may have 100 people in 20 jurisdictions combing through records on company ownership and other details.

"Nothing is capable of being completely hidden, if you're willing to put the time in," says Ain.