The leader of New Zealand's main liberal party has resigned after suffering a humiliating election defeat.

Labour Party leader David Cunliffe announced Saturday he was quitting but still planned to compete against other candidates in a primary to try and win the leadership back.

The announcement comes one week after the Labour Party suffered its worst election result in more than 90 years, winning less than 25 percent of the vote.

The election saw Prime Minister John Key returned to office for a third term after his center-right National Party won 48 percent of the vote.

In a statement, Cunliffe took responsibility for the loss.

The Labour Party's rules require it to now hold a leadership primary with weighted voting among party leaders, members and affiliates.