A binding referendum on legalising cannabis for personal use will be held at the 2020 general election.
The referendum is part of Labour's confidence and supply agreement with the Green Party, but wording of the question is yet to be confirmed.
Justice Minister Andrew Little says the Electoral Commission will now get on and start planning for it.
"Having made the decision now, the Electoral Commission has put together a budget bid for the budget process next year. So ... we'll now process that budget bid. It obviously will attract budget confidentiality, so we'll know about that next May."
Green Party MP Chloe Swarbrick said on Twitter the party was proud the referendum would go ahead.
"We've long advocated for a binding referendum with legislation setting out a clear, evidence-based regulatory framework. That way, we avoid a Brexit-type situation figuring out what a 'yes' vote means after the fact, and cut grey moral panic from the debate."
The Cannabis Referendum Coalition welcomed the timing, saying it would maximise turnout.
However, it was disappointed that there wasn't clarity on the referendum question.
"Our Coalition reiterates our preference for a two part question that asks firstly whether people support adults being able to possess and grow cannabis for personal use, and secondly whether they support adults being able to buy cannabis from licensed premises. This could be in the form of a modular bill, which allows one or both divisions to be passed depending on the outcome of the referendum," spokesperson Sandra Murray said.
"Having said that, we will be campaigning hard for a yes vote to any progressive question. We are excited to be having the debate. We are focusing on supporting local areas to have an informed discussion about how reform will benefit their community, as well as how potential problems will be avoided. We already have a network of regional groups to support this."
National Party leader Simon Bridges questioned the government's motivation for holding the referendum at the same time as a general election.
"I'm pretty cynical that you've got a government here that wants to distract from the core issues of a general election like who's best to govern, their actual record in government over the last three years, and core issues around the economy, tax, cost of living, health, education, law and order."
And he said the government had already effectively decriminalised cannabis through the medicinal cannabis bill.
"Now you're allowed loose leaf out on the streets and the truth is they've said to police, you don't need to prosecute this so right now, if someone's smoking cannabis outside a school what are the consequences? What's the message?"
Mr Bridges said he had never smoked cannabis.
Three referendums?
Legal cannabis could be one of potentially three referenda - decisions have yet to be made about euthanasia and changes to electoral laws.
Whether or not there would be a euthanasia referendum was up to the ACT leader, David Seymour, as he continued work on his member's bill, and the select committee considering it, said Mr Little.
"David has certainly told me that he fully expects that there would be a referendum clause in that bill when it gets reported back or goes through the House again."
Discussions were ongoing about a question on possible changes to electoral law - specifically to lower the party vote threshold to four percent, and remove the so-called 'coat-tailing' provision.