David Cameron tried to end the controversy over the tax status of his biggest donor Lord Ashcroft by revealing on Sunday that he will pass a law requiring all parliamentarians to be full UK taxpayers.

Ashcroft has repeatedly refused to clarify whether he has abided by a commitment made a decade ago to become a full UK taxpayer.

Cameron has also refused to disclose Ashcroft's tax status, but apparently recognising that the issue was going to dog him through the election, Cameron announced he will rush through law requring all parliamentarians to be UK taxpayers.

Conservative officials said Lord Ashcroft has been consulted about the proposed new law and has accepted the reform.

Over the last fortnight Cameron ran into fresh difficulties over the long running issue when it was disclosed that Zac Goldsmith, the Tory candidate for Richmond Park and a prominent environmentalist, had, until April this year, claimed offshore non-domicile tax status for the past decade. Goldsmith says he has always been tax-resident in the UK and paid taxes here.

At that time Cameron claimed MPs and peers were in a different position since peers are not responsible for legislation on government finances.

But it is possible Cameron felt the rationale for this distinction between peers and MPs was going to be hard to maintain.

Speaking on Sky News, Cameron said: "If you want to be in the Houses of Parliament you need to be, or be treated as, a full UK taxpayer."

He added: "We would pass that law if we get elected. We would pass it straight away, we would bring it into force as rapidly as we could. I think that would put the situation beyond doubt."

He said all parliamentarians would have to disclose their tax status to parliament's regulatory authorities, probably the Independent Parliamentary Standards Authority.

Labour said the Cameron announcement was brazen since it has already promised to bring in a law debarring "non doms" from becoming peers.

Chris Huhne, the Liberal democrat home affairs spokesman claimed: "David Cameron's plan is a sham. The super rich like Lord Ashcroft, Zac Goldsmith or Labour's Lord Paul can be fully resident for tax purposes in the UK, but if they are able to opt for non-dom status they will not pay a penny in UK tax on their main fortune outside Britain."

Ashcroft has given more than £5m to the Conservative party mainly though his company Bearwood Services. He has extensive business interests in Belize.

Cameron said donations to his party by Ashcroft though his company were "within the law". Since January the electoral commission had been investigating whether Bearwood is trading in Britain or is being used to funnel money to the Conservatives from overseas. By law, a British political party can only accept a donation from someone registered to vote in Britain or from a company "carrying on business" here.

Overseas residents can make donations to British political parties if they are made through British-registered companies that conduct most of their business in Britain. Ashcroft does not make donations to the Conservative party in an individual capacity because donors have to be listed on the electoral roll.

He refuses to reveal whether he is registered to vote in Britain and he regards his tax affairs as private. Ashcroft tightly controls the party's key seats campaign and requires candidates to send details of how hard they have campaigned in previous months.

Labour claims that Bearwood, which is a British registered firm, has been the beneficiary of cash from Stargate Holdings, a Belize-based company. Overseas companies are banned from making donations to political parties in Britain.

Denis MacShane, one of the Labour MPs who has campaigned hardest over Ashcroft's tax status, said: "Cameron's gimmick is only necessary because he and William Hague have persistently dissembled over Lord Ashcroft's status and have been deeply embarrassed by the Zac Goldsmith scandal.

"As well as calling for a law Cameron should now finally publish the tax and residence status of Lord Ashcroft and he should suspend Goldsmith as his most prominent candidate until he has paid back all the taxes that his non-dom status have protected him from."

The Liberal Democrats claimed Goldsmith may have avoided paying as much as £5m.

Lord Adonis, the transport secretary, said Cameron's pledge for legislation to ensure all MPs and peers were British taxpayers was a "red herring", arguing that legislation was not needed for individuals to change their tax affairs.

He said: "You could say why have the people he's talked about not put their tax affairs in order anyway?"

• This article was amended on 16 December 2009. It said, in error, that David Cameron instructed Zac Goldsmith to bring his tax affairs onshore and this statement was removed. Furher amendments were made to make clear that Goldsmith decided to end his non-domicile status in April 2009 and to include Goldsmith's statement that he has always been tax-resident in the UK and paid taxes here.