Greens senator Scott Ludlam has resigned from parliament after discovering he is a dual citizen of Australia and New Zealand.
The 47-year-old, who entered the Senate in July 2008, posted the shock resignation on Facebook and Twitter on Friday afternoon.
He has resigned effective immediately as a senator for Western Australia and as the co-deputy leader of the Greens.
Dual citizens are banned from holding office in the federal parliament under the Australian Constitution.
"Recently it was brought to my attention that I hold dual citizenship of Australia and New Zealand," Ludlam wrote.
"I was born in Palmerston North New Zealand, left the country with my family when I was three years old, and settled in Australia not long before my ninth birthday. I was naturalised when I was in my mid-teens and assumed that was the end of my New Zealand citizenship.
"This was my error, something I should have checked when I first nominated for preselection in 2006. I have no wish to draw out the uncertainty or create a lengthy legal dispute, particularly when the Constitution is so clear."
In a press conference following the announcement, Ludlam was asked: "Does this mean you were officially never a Senator?"
"Technically, that is correct. We apparently have imagined the whole thing," he joked.
Ludam said he apologised "unreservedly" for his mistake and was devastated by the consequences.
"I am personally devastated to learn that an avoidable oversight a decade ago compels me to leave my colleagues, supporters and my wonderful team," he said.
"You are the people who entrusted me as your candidate and sent me to parliament, and you are the people who turned out in force as we fought an unprecedented by-election in 2014. You supported me through the challenges of the past year and gave me the strength to return to the political arena. You know who you are, and I’ll never forget your support."
The ABC's election analyst, Antony Green, wrote on Twitter that Ludlam's resignation would cause a recount and the number 3 Greens candidate, Jordan Steele-John, would be elected. Steele-John told the Guardian he was unsure at this stage if he would take the spot.
Steele-John gave up his own British citizenship to first run for the seat of Fremantle as an 18-year-old, the Guardian Express reported last year.
Given Ludlam was never validly elected, it is possible that he could be pursued to pay back his salary over the year – a figure that amounts to millions of dollars.
"Our first priority was making sure disclosure was made in a timely way and we were clear about the legal and constitutional situation and my staff will be looked after," he said.
"Now, this afternoon I am writing to the Senate president, I spoke to him a short time ago and we will cross that hurdle if they come after me for $10 million."
"I am hoping common sense prevails."
Ludlam took a leave of absence to treat his depression and anxiety between November 2016 and January 2017.
Last week, he travelled to New York at his own expense to address the UN conference on the nuclear weapons ban. Australia did not attend the treaty negotiations, provoking anger from Aboriginal victims of British nuclear tests in Australia from 1952 to 1963.
"I've been incredibly fortunate to serve these past nine years in the Australian Senate. The scruffy kid who cut his teeth at the Jabiluka uranium blockade was honoured last week to speak in the United Nations plenary on the historic nuclear weapons ban. It’s not a bad way to go out," Ludlam said.
Fellow parliamentarians paid tribute to him on Twitter, including Greens leader Richard Di Natale and Ludlam's co-deputy leader, Larrisa Waters.