Zimbabwe’s main opposition leader, Morgan Tsvangirai, has died aged 65. He had been suffering from colon cancer for at least two years, but his condition deteriorated rapidly in recent days despite treatment in neighbouring South Africa.

His death will be an enormous blow to the opposition in Zimbabwe, coming only months before the first elections were due to be held in the former British colony since the end of Robert Mugabe’s near four-decade rule last year.

Tsvangirai’s illness, revealed in 2016, has divided his Movement for Democratic Change (MDC) party, with three deputy leaders and other officials publicly manoeuvring to succeed the former trade union leader.

The party will have to choose a new leader and launch a campaign against a resurgent Zanu-PF, the ruling party, to contest polls that may be held as early as May.

Without its founder at the helm, the MDC is likely to face immediate instability and could even split, handing a gift to Zimbabwe’s new president, Emmerson Mnangagwa. A broader alliance of seven political parties formed last year to take on Zanu-PF could also be destabilised.

“Tsvangirai’s death will force the MDC to convene an emergency conference to sort out the differences between the three vice-leaders. His sickness meant an impasse around internal dynamics so this might force a resolution. That’s a possible silver lining to this tragic event,” said Piers Pigou, Zimbabwe analyst for the International Crisis Group.

Tsvangirai died in a clinic in Johannesburg. Elias Mudzuri, one of the MDC’s vice presidents, said on Twitter: “Dr Morgan Richard Tsvangirai has not been feeling well for some time, it is sad for me to announce that we have lost our icon and fighter for democracy. Our thoughts and prayers are with the family, the party and the nation at this hour.”

Temba Mliswa, an independent MP, called Tsvangirai “a true democrat who fearlessly stood up to the Mugabe regime and was an inspiration to many”.

He added: “Although we may have differed politically I held a deep respect for MT.”

David Coltart, one of the founders of the MDC, said Tsvangirai was “one of the giants of the long struggle to bring democracy to Zimbabwe”. He added: “I will remember him for his courage, humility, humour and relentless determination.”

The course of Tsvangirai’s life was determined by his long political battle against Mugabe, the former guerrilla leader who had run Zimbabwe since independence from Britain in 1980 until November.

The oldest of nine children, Tsvangirai left school at 16 to help support his family. As a young miner he become a labour activist and rose through the ranks of the Associated Mine Workers Union. In 1988, he was elected secretary general of the Zimbabwe Congress of Trade Unions (ZCTU), the overarching body of the country’s labour movement.

In 1999, Tsvangirai founded the MDC. Although heavily influenced by the trade union movement, the party incorporated the church, business, women’s and students’ organisations and other interest groups.

As Mugabe launched a programme of radical measures designed to bolster his power but which brought economic chaos, Tsvangirai and the MDC stepped up their challenge to the government through a series of nationwide strikes and, despite fierce intimidation, came close to winning power in parliamentary elections in 2000 and in a presidential vote in 2002.

Tsvangirai’s leadership was questioned after a serious split in MDC ranks in 2005, when he overruled a decision by the party’s leadership to take part in elections for the senate and ordered a boycott.

Morgan Tsvangirai after being beaten by Zimbabwe security forces in 2007. Photograph: Desmond Kwande/AFP/Getty Images

Mugabe’s tactics of harassment enhanced the opposition leader’s reputation as a tenacious, courageous opponent of repression. Images of Tsvangirai after being badly beaten following a prayer meeting that police claimed was illegal were published around the world.

The MDC won the first round of elections in 2008 in the face of a vicious state campaign of violence against party workers and supporters. The MDC eventually joined a unity government that lasted until the 2013 election, which Mugabe won.

Criticised for his obvious affection for the outward trappings of power and failure to make a significant impact in the office of prime minister, Tsvangirai emerged from office a diminished figure. A leaked US diplomatic cable described him as “a flawed figure, not readily open to advice, indecisive and with questionable judgment”.

Tsvangirai nonetheless dominated the fractured opposition in Zimbabwe until his death.

“He was the presidential candidate for the opposition alliance. Recently they have been campaigning on the spirit of Tsvangirai alone. The dilemma is now to find someone who will play that central role,” said Pigou.