John Banks, the leader of New Zealand's ACT party, has resigned as a minister after he was ordered to face trial for electoral fraud.
Auckland District Court Judge Phil Gittos on Wednesday ruled that Banks, who is MP for the Auckland electorate of Epsom, must stand trial on a charge under the Local Electoral Act.
It followed a private prosecution by retired Wellington accountant Graham McCready, who alleged Banks' declared donations to his 2010 Auckland mayoral campaign from internet mogul Kim Dotcom and casino operator SkyCity as anonymous when he knew who they were from.
Banks has pleaded not guilty, and outside court he said he was not considering standing down from his ministerial portfolios, which include regulatory reform and small business, along with associate commerce and education roles.
However, less than an hour later, and after speaking with Prime Minister John Key, he announced his resignation.
Banks said he had indicated to Key's chief of staff last week that he would resign if the matter went to trial.
"I believe the decision in the Auckland District Court was wrong and I will be contesting the charge. However, I do not want this to be a distraction from the government's program," he said.
Banks said he would remain an MP and ACT leader, and support the National government on confidence and supply issues.
"My focus will now be on clearing my name and serving the people of Epsom," Banks said.
Key said he accepted Banks' resignation with regret.
"Mr Banks maintains his innocence but realises this is a distraction for the government.
"Even though the events occurred before Mr Banks entered parliament in 2011, this is totally the right call."
Key said Banks would be reinstated if he successfully appealed Judge Gittos' ruling or was found not guilty.
It was likely if Banks had not jumped, he would have been pushed.
Earlier this year, police found the election return was wrong because donations from Dotcom, Sky City and another donor shouldn't have been recorded as anonymous, but there was insufficient evidence to lay charges, and it was past the statutory time limit to do so.
Labour and the Greens say Banks should not be allowed to vote on legislation for the government's deal with SkyCity to build a new Auckland convention centre.
SkyCity chief executive Nigel Morrison will be a key witness at the trial, while Banks has the deciding vote on the convention centre legislation.