Mr Cameron has allowed Cabinet ministers to campaign against remaining within the EU, and Mrs Villiers is part of a six-strong anti-EU group which also includes ministers Michael Gove and Chris Grayling,

Mr Cameron told the House of Commons: "The Secretary of State for Northern Ireland does an excellent job.

"She is exercising her ability to reach a personal decision and to campaign for Britain to leave the EU and that's absolutely right she is able to do that.

"I think the key thing is everybody in Northern Ireland should make up their own mind based on the evidence and I look forward to coming to try to help persuade them to remain in a reformed EU."

Mr McGuinness said: "It's odd that Theresa Villiers should now be advocating withdrawing from the EU when its benefits for the North are quite obvious.

"It's not surprising, however, given the fact that she is not elected by and does not represent the people of the North that she should be so cut off from public opinion."

Mr Eastwood said Mrs Villiers had chose to "join the extremists and the eccentrics" and used her ministerial office "to lend weight to a campaign whose goals are in direct conflict with the interests of the people of Northern Ireland."

He said Mrs Villiers would have little choice except to resign if the result of the referendum on June 23 is to remain within the EU.

But a spokeswoman for Ms Villiers responded: "The Prime Minister has made clear ministers would be free to campaign in a personal capacity ahead of an EU referendum.

"The Secretary of State remains totally focused on her ongoing and determined efforts to build a brighter, more secure future for NI. To suggest otherwise is ludicrous."

Sinn Fein, the SDLP and Alliance Party are all campaigning for the UK to remain inside the EU.

The DUP are backing Brexit while allowing individual members to vote to stay, and the executive of the Ulster Unionist Party is planning to meet next week to decide on their position.

But leader Mike Nesbitt has already said: "I would hope to recommend that we stay in."

The party had wanted to see the outcome of Mr Cameron's negotiations with the EU on a range of issues, but Mr Nesbitt had indicated a vote to leave could pose an "existential threat" to the UK.

That is due to fears that if a majority of voters in Scotland are in favour of remaining, another independence referendum in Scotland could be triggered.

"As I see it, as a unionist, Brexit is about uncertainty," he said at an event organised by the Centre for Cross-Border Studies.

DUP leader and First Minister Arlene Foster said: "At every stage in this European negotiation process we had hoped to see a fundamental change to our relationship with Europe.

"We see nothing in this deal that changes our outlook. Therefore we will on balance recommend a vote to leave the EU.

"We fully expect that DUP members and voters will hold a range of differing personal views as to what is in the best interests of the UK.

"They are entitled to do so during what will be a momentous political debate about the direction of travel our nation chooses."