JOHANNESBURG - Zimbabwean opposition leader Morgan Tsvangirai died Wednesday at age 65, ending a long campaign to lead his country that brought him jailings, beatings and accusations of treason.

Tsvangirai died Wednesday evening in a Johannesburg hospital, said Elias Mudzuri, a vice-president of the Movement for Democratic Change party. The opposition leader had been battling colon cancer for two years.

Tsvangirai for years was longtime ruler Robert Mugabe's most potent challenger and even became prime minister in an uncomfortable coalition government for a few years. Mugabe, 93 and in power for 37 years, resigned in November after pressure from the military and ruling party.

In January, the ailing Tsvangirai suggested that he would be stepping down, saying he was "looking at the imminent prospects of us as the older generation leaving the levers of leadership to allow the younger generation to take forward this huge task."

His death leaves the opposition in disarray just months before national elections. An opposition alliance had endorsed him as its candidate, even as his deputies tussled to act as party leader while he was out of the country for treatment.

Those power struggles are now likely to intensify, which may give an edge to the ruling party, ZANU-PF, and its candidate, President Emmerson Mnangagwa.

"We are still mourning. This is not the time to talk about that," MDC party spokesman Obert Gutu said.

Tsvangirai came tantalizingly close to the presidency in 2008 when he won the most votes in the election. But the results, delayed nearly a month as Mugabe's officials "verified" the count, gave him just 47 per cent, shy of the more than 50 per cent majority needed to win outright. Tsvangirai boycotted the runoff, citing widespread violence against his supporters, handing Mugabe the victory.

Negotiations then led to the coalition government, an uneasy alliance that ended in 2013 when Mugabe won elections amid charges of intimidation and rigging.

Being Mugabe's most prominent opponent brought Tsvangirai considerable hardship. He was jailed several times and charged with treason. He suffered a fractured skull and internal bleeding when he and more than a dozen other leaders of his party were arrested and beaten with gun butts, belts and whips in 2007.

In an earlier incident Tsvangirai was almost thrown from his office window by a government agent.

"Morgan Tsvangirai will be remembered as one of Zimbabwe's great patriots," opposition figure and human rights lawyer David Coltart said Wednesday night. "Although, like all of us, he made mistakes none of us ever doubted his commitment to transform Zimbabwe into a modern, tolerant state."

Born March 10, 1952 in the rural Buhera area southeast of the capital, Harare, Tsvangirai was the oldest of nine children. After graduation from secondary school he worked at the Bindura Nickel Mine for 10 years, eventually becoming plant supervisor. It was during the years of the nationalist war against white minority-ruled Rhodesia. Tsvangirai later said he did not join the guerrilla fighters because his salary supported the education of his younger siblings.

When Zimbabwe became independent in 1980, Tsvangirai joined Mugabe's ZANU-PF party and became active in trade unions, rising to become secretary general of the Zimbabwe Congress of Trade Unions. The labour organization had been a rubber stamp supporter of Mugabe and ZANU-PF, but under Tsvangirai's leadership it became a vocal critic of Mugabe's government.

The labour federation became a key component of an emerging network of anti-government civil society groups including lawyers, students and churches demanding an end to worsening human rights abuses and deepening economic problems.

In 1999 he founded the MDC, which attracted support from blacks and whites and in rural and urban areas. The party quickly became a serious challenge to Mugabe's party.

Tsvangirai was also leader of the National constitutional Assembly, a coalition of civil society groups that successfully campaigned in a 2000 referendum against a new constitution they alleged gave Mugabe too many powers. Most of the organization's leaders joined Tsvangirai's MDC.

Nine months after its formation, the MDC won 57 seats in parliament, five short of the ruling party's 62, the first time Mugabe's party came close to losing its parliamentary majority.

Tsvangirai then continued for years as the country's opposition leader, facing significant repression from Mugabe and ZANU-PF.

Shortly after becoming prime minister in 2009, Tsvangirai suffered a serious blow when his wife, Susan, died when the car they were travelling in overturned. Without his wife, Tsvangirai lost domestic stability and became involved in romances that were widely publicized by the Zimbabwean press.

His time as prime minister was criticized as being marked by his search for a new wife and also by his enjoyment of the trappings of power, but Tsvangirai was also credited with encouraging stability, civility and international goodwill. His long struggle as Mugabe's main challenger was credited with helping to keep a measure of democratic space open in Zimbabwe.

"Thank you for making it possible for people like me to find the courage to say enough is enough," said pastor Evan Mawarire, who led large anti-government protests in 2016. "Zimbabwe owes you a great debt."

___

This story was corrected to show that Tsvangirai successfully campaigned against Mugabe's constitutional referendum in 2000.