David Shearer has resigned as leader of New Zealand's Labour opposition. Photograph: Laura McQuillan/AAP

New Zealand's opposition leader has quit, declaring he does not have the support of his colleagues ahead of national elections in 2014.

David Shearer led the centre-left Labour party for 20 months but appeared to struggle at times in the spotlight. Opinion polls indicate he never gained much support among New Zealanders as preferred prime minister.

John Key, on the other hand, continues to enjoy high levels of support as PM after first taking office in 2008.

Shearer will remain in parliament for the moment and has not said whether he will contest his seat next year. In a statement he said it was time for a change.

"There was no letter, there was no ultimatum, there was no vote," he said. "But from the soundings I have taken from colleagues, I realise I no longer enjoy the confidence of a number of my caucus colleagues."

Shearer said he came into politics to make a difference and "I believe I have done that".

The Labour party plans to pick a replacement in the coming weeks.

Among those expected to vie for the role are deputy leader Grant Robertson and associate finance spokesman David Cunliffe.

Shearer was elected to parliament in 2009. He previously worked for the United Nations and was named New Zealander of the Year by the New Zealand Herald newspaper in 1993 for his work in Somalia.