Mr Flavell challenged for the leadership in January and the party was expected to try to resolve it at a conference this weekend. However, the Ikaroa-Rawhiti byelection result in which Mana's Te Hamua Nikora beat the Maori Party's Na Raihania by 500 votes put more pressure on the party and Dr Sharples, who conceded that the leadership uncertainty was a factor that hampered the campaign.
"The reality is we are going nowhere and so we have to have a united front. If it takes my resignation to do that, I will do that. I'm being real, that's all."
He chose to announce his resignation early, partly to avoid further damaging speculation about the contest in the lead-up to the annual hui.
"I wanted to make the announcement sooner rather than later so that at the AGM we can look forward rather than back."
He maintained he and Mr Flavell were still good friends and worked together well, but conceded that the perception was one of division.
Dr Sharples' decision means the Maori Party will lose both of its founding co-leaders at the same time.
He and Mrs Tariana Turia set up the Maori Party in 2004 after Mrs Turia left the Labour Party in protest at the Foreshore and Seabed Act.
Dr Sharples told Mrs Turia about his decision yesterday and was telling Prime Minister John Key and Mr Flavell last night.
He said it was a sad day for him. "I'm proud of what we have achieved with the Maori Party and will be a supporter of the kaupapa until I die."
After eight years in Parliament, including five as a minister, he also wished to spend more time with his wife, who has struggled with health issues, and his mokopuna.
Many have blamed the Maori Party's slump in fortunes on its support for the National Government, but Dr Sharples said he still believed it was right to get around the Government's table.
"I do so believe, and I can't understand why the rest of our people can't understand, that we need to have a mass of Maori in there carrying the kaupapa."
Although Dr Sharples' decision will avoid a bitter leadership battle, it will make it make it harder for the Maori Party to retain at least two of its current three seats because new candidates will be standing in both Mrs Turia's Te Tai Hauauru and Dr Sharples' Tamaki Makaurau seat. Dr Sharples held onto the seat by a slim majority of 936 in 2011 against Labour's Shane Jones. That was well down his 2008 majority of 7,540 - before the Maori Party went into Government with National and Hone Harawira left the party to set up Mana.
Dr Sharples had previously refused to give way to Mr Flavell, arguing he needed to stay on longer to provide some stability after Turia retired in 2014. Dr Sharples said that although he and Mr Flavell were still close and worked well together despite the leadership challenge, there was a perception that the party was divided and it was difficult to fight against that.
Dr Sharples has spent much of the past two days defending the Maori Party's result in that byelection, saying part of the reason it was beaten was because Mr Nikora was well-known and the Labour Party had put all of its considerable resources into the seat, which the Maori Party could not compete with. Although Mr Raihania's portion of the vote was only slightly lower than in 2012, it is the first time a Mana candidate has beaten the Maori Party in a Maori electorate.
It prompted Mana leader Hone Harawira to call for the Maori Party to fold in with Mana although the Maori Party MPs have been unenthusiastic about that.