Labour Leader David Cunliffe says he has been given a written police warning about a tweet he posted on the day of the Christchurch East byelection urging people to vote for Labour candidate Poto Williams.
Mr Cunliffe says he has taken the warning on board and will not repeat the error.
The tweet said: "If you are resident in Christchurch East don't forget to vote today - for Labour and Poto Williams."
At the time he had about 6,400 followers on Twitter.
The tweet was referred to the police by the Electoral Commission - electioneering is banned on election day.