UK Prime Minister David Cameron this week experienced arguably his rockiest moment in power, thanks to his disastrous management of questions from the media about his involvement in an offshore investment fund established by his late father that appeared in the Panama Papers.

After a series of evasive statements since Monday, Cameron’s admission on Thursday during a TV interview that he had sold shares worth £30,000 ($42,000) in company Blairmore Holdings Inc. months prior to becoming prime minister in 2010 quickly drew demands for his resignation from opposition politicians. The hashtag #ResignCameron was trending on Twitter on Friday.

The massive leak of internal records from Panama-based offshore investment specialist law firm Mossack Fonseca, which was first disclosed on Sunday, has already generated trouble for other political leaders, with Iceland’s Prime Minister Sigmundur Gunnlaugsson stepping down for an unspecified amount of time — having back-pedaled on full resignation — while Argentina’s President Mauricio Macri has faced calls to step down.

Cameron has been widely lambasted on social media for his apparent hypocrisy, given statements he made in 2012 branding the tax avoidance of well-known comedian Jimmy Carr “morally wrong” and his government’s ongoing insistence it is taking strong action to reclaim some of the estimated £32 billion ($45 billion) being lost to tax avoidance and evasion each year. When Britain hosted a G8 summit in 2013, Cameron made tackling tax avoidance a key element of the agenda.

So the revelation that he had held shares in his father’s company — a “collective investment fund” that managed millions of pounds of shareholders’ money that didn’t pay any tax in the UK for 30 years despite having five UK-based directors — has generated outrage. But were Cameron and his father actually trying to avoid tax?

A former senior tax partner at a major law firm, who asked not to be named, said the outrage is founded on a misconception. The motivation to establish collective investment funds like Blairmore outside the UK is not to avoid tax, he said, but to avoid some of the regulations enforced by the Financial Conduct Authority on how such a fund must be operated and what it can invest in if registered at home.

Those regulations include the demand for stocks to be bought and sold each day, and restrictions on what the funds can invest in, with purchases of commodities such as gold and silver forbidden.

“The investment manager who was investing the portfolio had greater freedom in what he was investing in, but Cameron and other investors were passive investors,” he said.

Moreover, he said, the tax arrangements of Blairmore Holdings are very similar to those enjoyed by investment funds based in the UK.

“In all collective investment schemes, there is no tax — or effectively no tax — at the collective level,” he said. “People are saying it’s wrong that Blairmore — and any other offshore fund — didn’t pay any corporation tax, but no investment fund in the UK pays corporation tax.”

According to the tax expert, the way Blairmore Holdings operated is incomparable to the sort of tax avoidance scheme Carr was involved in, which saw him funnel £3.3 million ($4.6 million) into an offshore fund each year and have it paid back to him as a loan — effectively allowing him to pay just 1 percent tax.

Collective investment funds, on the other hand, are exempt from capital gains or income tax because the tax on the funds is levied on the investors.

“Clearly if you had a layer of tax on that fund in the middle… you’ve got a disadvantage, because you’d end up being taxed twice, once on the fund level and once in your own hands,” he said.

However a prospectus written by Blairmore for potential investors in 2006 suggested tax evasion was absolutely part of the motivation for being based offshore.

“The fund is not liable to taxation on its income or capital gains as long as such income or capital gains are not derived from sources allocated within the territory of the Republic of Panama,” the prospectus read.

“The directors intend that the affairs on the fund should be managed and conducted so that it does not become resident in the United Kingdom for UK taxation purposes. Accordingly … the fund will not be subject to United Kingdom corporation tax or income tax on its profits.”

According to John Christensen, executive director at tax fairness advocacy group Tax Justice Network, it is far too early to exonerate Cameron or Blairmore Holdings of any wrongdoing.

“We don’t know until it has been properly investigated, and ruled on in a court of law. Until then, we cannot know,” he said. “We can’t say with any degree of certainty whether any scheme is legal or illegal.”

According to Christensen, regardless of the legality of the fund’s activities, the fact Cameron was so willing to challenge the morality of other people’s tax arrangements at a time when he had not fully disclosed his own dealings offers fair grounds for him to be challenged.

“In terms of legitimacy, we can be certain that it is questionable,” he said. “Inevitably when offshore structures are involved, there will be an element of tax avoidance.”

For Richard Murphy, a chartered accountant who campaigns for tax justice and serves as economic advisor to the UK’s Trade Union Congress, the greatest problem in Cameron’s actions was not the fact he made a relatively small amount of money from an offshore fund, but that he has refused to distance himself from his father’s financial activity.

“We can say that his father was undoubtedly seeking to pay no tax in the UK,” said Murphy. “He said ‘I’m proud of what my dad did.’ But hang on a minute, his dad went off and created an offshore fund with the express purpose of avoiding tax.”

According to Murphy, while the small tax advantage his father’s offshore fund earned my not be as serious as Carr’s dealings, failing to condemn it sends an inconsistent message to the public about how serious tax avoidance is.

“There is in that the duality, that one was condemned and one was condoned,” he said.