Michael Rattner — the man who leaked Pauline Hanson emails allegedly showing a vote-rigging cover-up at the NSW Electoral Commission — has been arrested in Sydney and exposed as a phoney.

Rattner is, in fact, Sean Castle: the man who posed as a fake Daily Telegraph journalist to obtain embargoed progressive poll results from the electoral commission in the aftermath of the March NSW state election.

At the NSW supreme court this afternoon he admitted he had regularly misrepresented himself as a “Michael Rattner”.

Crikey revealed earlier today that the Rattner man-hunt was nearing completion. Before lunchtime Castle, a married man who lives in Glendenning, had been found by police. He handed himself in at the Rocks police station, according to Hanson’s solicitor David Leamey. Cached posts from his now-deleted Facebook account also reveal that he is a history teacher and avid fan of Hey Hey It’s Saturday.

Hanson, who narrowly missed out on the last NSW upper house spot, has based her legal challenge on alleged email exchanges between the NSW Electoral Commission’s chief information officer and communications manager suggesting counting by “dodgy staff” may have cost her up to 1200 votes. Both men emphatically deny sending the emails.

Sean Castle’s identity bares little resemblance to that of Michael Rattner, who was supposedly a construction worker whose girlfriend worked in the electoral commission. One newspaper report quoted “Rattner” saying he had gone interstate to help friends affected by the Queensland floods. In a rather bizarre touch, according to Hanson’s legal team, Rattner’s Facebook page said he was gay — although his girlfriend supposedly leaked the emails to him.

There was some confusion and amusement when Hanson’s lawyers questioned whether the subpoena relating to Rattner were now valid for Sean Castle.

Castle appeared in court wearing a blue shirt and tie, and a black overcoat. He is pale, with sunken eyes, and has short brown hair. He did not say what motivated him to pose as Rattner. Castle will be released from custody this afternoon on the condition he reappears in court on Tuesday.

Hanson did not appear in court, staying at her Corlette home, near Port Stephens, instead.

Speaking after the hearing, Greens MP Jeremy Buckingham, who was locked for weeks in a three-way tussle for the final NSW upper house seat, said: “Pauline Hanson should do the right thing and drop the case as soon as possible.”

He said he may still pursue her for costs, even though she appears to have been the victim of an elaborate hoax.

David Leamey, a solicitor for Hanson, denied that today’s revelations were a major embarrassment for her legal team.

“We don’t know what he [Sean Castle] has got to say yet,” he said.