South African jazz legend and anti-apartheid activist Hugh Masekela has died, aged 78.

Masekela "passed peacefully" in the country's commercial capital, Johannesburg "after a protracted and courageous battle with prostate cancer," his family said in a statement on Tuesday.

Widely known as "The Father of South African Jazz", Masekela was a leading figure in the struggle against white-minority rule. His song "Soweto Blue" became synonymous with the anti-apartheid movement.

His unique Afro-Jazz sound catapulted him into international recognition, leading to a career spanning more than five decades.

Aged 21 in 1960, Masekela went into a 30-year exile to escape the apartheid regime in South Africa.

Following the release of Nelson Mandela, Masekela returned to his land of birth in 1990.

Masekela performed at both the opening concert of the 2010 Fifa World Cup and the tournament's opening ceremony in Soweto's Soccer City.

South African President Jacob Zuma said the nation would mourn a man who "kept the torch of freedom alive".

"It is an immeasurable loss to the music industry and to the country at large. His contribution to the struggle for liberation will never be forgotten," Zuma said in a statement.

Bubele Mgele, popularly known as Mr B, a musician who worked with Masekela on the Grammy nominated album "Jabulani", described him as "generous, kind and people's person".

"It was a great experience for us. For many of us, he was our introduction to the world," the 40-year-old artist who plays for the Afro-jazz group iComplete based in Johannesburg, told Al Jazeera.

"For me, he leaves behind a legacy of fighting for our freedom and for being a pioneer in taking our South African sound to the world ...Together with Miriam Makeba, he told the world what was going in South Africa during apartheid through jazz," Mgele said.

Arts and Culture Minister Nathi Mthethwa tweeted: "A baobab tree has fallen, the nation has lost a one of a kind."

Masekela was married to singer and activist Miriam Makeba, known as "Mama Africa", from 1964 to 1966.

Additional reporting by Azad Essa in Johannesburg.