Three stars of hit BBC sitcom Mrs Brown's Boys diverted more than £2m into an offshore tax-avoidance scheme, Paradise Papers documents show.

Patrick Houlihan and Martin and Fiona Delany transferred their fees into companies in Mauritius and sent money back as loans.

Similar tax avoidance schemes have been subject to investigation and challenges by HMRC in recent years.

The actors have not responded to the BBC's requests for comment.

Houlihan told the Irish Times he had joined the scheme after receiving professional advice without fully understanding it.

Roy Lyness, who put the stars in touch with the advisers behind the set-up, was the accountant behind the similar tax avoidance scheme used by comedian Jimmy Carr.

Paradise Papers - exposing the tax secrets of the ultra-rich

Media playback is unsupported on your device Media caption Richard Bilton asks Mrs Brown’s Boys star Fiona Delany about the offshore scheme.

The revelation in 2012 that Carr had used a Jersey-based tax shelter attracted criticism from then-Prime Minister David Cameron.

It led to the comedian saying he had made "a terrible error of judgement".

The leaked documents held by offshore law firm Appleby show how the three Mrs Brown's Boys stars put their fees from a production company owned by Brendan O'Carroll, the creator and star of the show and real-life father of Fiona Delany, in companies they controlled in Mauritius.

Mr O'Carroll said neither he nor his companies have been involved in a tax avoidance scheme or structure and the actors' wages were paid into a UK company bank account.

Mr O'Carroll's production company is registered at accountant Mr Lyness's office in Oldbury in the West Midlands.

Mr Lyness said he was "bound by client confidentiality as well as duties under the Data Protection Act not to divulge confidential information concerning my clients' financial affairs".

Worldwide hit

Mr O'Carroll plays Irish matriarch Agnes Brown in Mrs Brown's Boys. Patrick Houlihan is one of the boys - Dermot. Fiona Delany stars as Mr Houlihan's nurse wife Maria, and her real-life husband, Mr Delany, stars as Trevor Brown, the youngest son.

Image caption The show's creator, Brendan O'Carroll, stressed he had never been involved in a tax avoidance scheme or structure

The sitcom started life as a radio show on RTE 2FM in the Irish Republic and became a worldwide hit after being turned into a TV series by the BBC and RTE in 2011. There is also a successful stage show which tours the world.

A film, Mrs Brown's Boys D'Movie, came out in 2014, and the show's Christmas specials are among the UK's top-viewed festive programmes.

Investment advisers

The Paradise Papers documents suggest the actors' fees from their work connected to Mrs Brown's Boys was sent offshore to avoid income tax and national insurance.

Source document

Image caption The leaked documents show the trail of money being transferred to the actors via Mauritius

They show:

Brendan O'Carroll's production company pays a UK-based company for the actors' work

the UK company transfers the money to a trust set up in Mauritius by Appleby

the actors were self-employed contractors for the trust, which took a 12.5% cut of their fees, before transferring the money into three companies in Mauritius

the actors each had effective control over the companies

they took on the role of investment advisers, "recommending" their earnings be sent back to their personal bank accounts in the form of loans

the loans had been structured to avoid triggering rules brought in by the UK government to prevent similar schemes from operating - with the money paid into the accounts through a third party.

Documents for the 2014-15 financial year show Martin Delany's offshore company received £448,095 and Fiona Delany's received £448,168.

No figures are available for Paddy Houlihan, as his company's accounts for that period are not in the data.

But a spreadsheet for the next financial year shows in December 2015 Mr Houlihan's company had assets of £696,349, Fiona Delany's £715,122, and Martin Delany's £725,030.

Accelerated payment notices

In official guidance issued in 2016, HMRC said it would investigate and challenge such practices.

"Scheme promoters will tell you that the payment is non-taxable because it's a loan, and doesn't count as income," it said.

"In reality, you don't pay the loan back, so it's no different to normal income and is taxable.

"So if you're using one of these schemes and being paid this way you're highly likely to be avoiding tax."

Image caption Comedian Jimmy Carr's use of a tax avoidance scheme came to light in 2012

HMRC has the power to send people using these sorts of schemes "accelerated payment notices" - which require them to repay the tax immediately, while their case is investigated.

Told of the type of scheme being used by the Mrs Brown's Boys stars, MP Meg Hillier, who chairs the Commons Public Accounts Committee, said: "If it's not outside the actual rules it's certainly... way outside the spirit of the rules."

She added: "A decade ago perhaps it wasn't so much in the public domain, but now I don't think anybody with any sense would be just taking the advice of a tax adviser without asking certain questions... That's just common sense... these people ought to look at themselves in the mirror and ask themselves whether it's really fair what they're doing."

In a statement on the Paradise Papers leak, Appleby said it was a law firm which "advises clients on legitimate and lawful ways to conduct their business. We operate in jurisdictions which are regulated to the highest international standards".

The papers are a huge batch of leaked documents mostly from offshore law firm Appleby, along with corporate registries in 19 tax jurisdictions, which reveal the financial dealings of politicians, celebrities, corporate giants and business leaders.

The 13.4 million records were passed to German newspaper Süddeutsche Zeitung and then shared with the International Consortium of Investigative Journalists (ICIJ). Panorama has led research for the BBC as part of a global investigation involving nearly 100 other media organisations, including the Guardian, in 67 countries. The BBC does not know the identity of the source.

Paradise Papers: Full coverage; follow reaction on Twitter using #ParadisePapers; in the BBC News app, follow the tag "Paradise Papers"

Watch Panorama on the BBC iPlayer (UK viewers only)