Bra Hugh, as he was affectionately known in South Africa, played the fluegelhorn and cornet, as well as the trumpet, and he drew from genres as disparate as disco and mbaqanga, a style of South African dance music. He explored the percussion-heavy sound of Afrobeat, collaborated with trumpeter Herb Alpert on a pair of jazz-funk records, performed with the London Symphony Orchestra, and scored a No. 1 hit with a pop instrumental — the sunny 1968 track "Grazing in the Grass."
With encouragement from the globally renowned South African-born protest singer Miriam Makeba, his wife in the mid-1960s, he also lent his baritone voice to songs in Zulu, Xhosa and English. A political self-exile for three decades, he wrote the anti-apartheid protest anthem "Bring Him Back Home (Nelson Mandela)" (1987), inspired by a birthday letter Mr. Masekela received from the imprisoned activist and future South African president.
Mr. Masekela had been a virtuosic jazz musician in South Africa before landing in New York in 1960, aspiring to be a bebop star. Trumpeter Miles Davis suggested that he instead "make a name" for himself by fusing his knowledge of jazz and African song. Otherwise, Davis warned, "You'll be just like a thousand other jazz players; you'll just be a statistic."
Mr. Masekela took the advice, defying record executives who said his sound was "too African." He wryly mocked American listeners' understanding of Africa, titling his third solo album "The Americanization of Ooga Booga" (1966). The record's cover featured a barefoot Mr. Masekela standing in the jungle, holding a briefcase and clad in a Brooks Brothers suit.
Notable deaths in 2018 and 2019: Nipsey Hussle, George H.W. Bush, Stan Lee, John McCain, Aretha Franklin and other famous faces we’ve lost
Not all listeners appreciated Mr. Masekela's new sound — the record "pissed off a lot of jazz purists," he later told the Contra Costa Times — but Mr. Masekela remained a pop music fixture, in part through his work in rock-and-roll.
A friend of Jimi Hendrix's, he played trumpet on singles for the Byrds and performed at the 1967 Monterey Pop Festival, where his howling rendition of "Bajabula Bonke (The Healing Song)" was captured in an acclaimed documentary by D.A. Pennebaker.
"The Healing Song," a Swazi folk tune he learned from Makeba, initially served as a B-side for "Grazing." The song featured a jangling cowbell, a soaring trumpet solo and a melody written by actor-composer Philemon Hou. It climbed the charts a second time after the soul group Friends of Distinction added lyrics and recorded a cover version.
But his music never strayed far from politics. In concerts, Mr. Masekela discussed the meaning of songs such as "Stimela (Coal Train)," about displaced workers in Johannesburg, and "Soweto Blues," about a 1976 massacre of black schoolchildren, which he often performed with Makeba.
"I'm a parasite on the world's conscience, to make them scratch sometimes," he told Britain's Guardian newspaper in 1990.
In the early 1980s, he moved to Botswana to start a mobile recording studio and school for African musicians. The school, near the border of South Africa, shuttered in 1985 after defense forces from the apartheid regime conducted a raid in the area, killing 15 people.
With South African playwright Mbongeni Ngema, he composed and arranged the music for "Sarafina!," which opened in New York in 1987 — transforming "the oppression of black townships," New York Times theater critic Frank Rich said in a review, "into liberating singing and dancing that nearly raises the theater's roof." The show received five Tony Award nominations, including for best musical and best original score, and was adapted into a 1992 movie starring Whoopi Goldberg and Makeba.
Mr. Masekela was by then in the midst of a late-career resurgence, buoyed by a collaboration with Paul Simon. Simon had recorded parts of the 1986 album "Graceland" in South Africa with local musicians, breaking a United Nations boycott and infuriating anti-apartheid groups who argued that he was implicitly condoning the white-only government.
Mr. Masekela, however, saw the album as an opportunity to broaden the appeal of South African music. He organized a group of South African musicians who performed in stadiums worldwide during Simon's "Graceland" tour. With Makeba, guitarist Ray Phiri and the choral group Ladysmith Black Mambazo, he played hits such as "You Can Call Me Al" alongside protest anthems and the Pan-African liberation song "God Bless Africa."
"South Africa has become a spectator sport," Mr. Masekela told the Los Angeles Daily News in 1987, dismissing "Graceland" critics who argued that South African musicians shouldn't show support for Simon by playing with him on tour.
"If these people are prevented from playing with us overseas," he continued, "and they are prevented from playing over there in South Africa because of the color of their skin, then I don't know what the people who want to help us are aiming at. It is as if they are saying, 'We must deprive you in order to help you.' "
Ramopolo Hugh Masekela was born in the coal-mining town of Witbank on April 4, 1939. The son of a health-inspector father and social-worker mother, Hugh (as he became known) was raised mainly by his grandmother, who ran an illegal drinking house known as a shebeen.
Alcohol sales were prohibited for black South Africans, and "drunkenness to a great extent was a form of defiance," Mr. Masekela told NPR in 2013. He acknowledged addictions to "drinkin', cokin', smokin' — you name it, all the 'kins," before seeking treatment in the 1990s. Drug use, he said, led him to squander $50 million over the course of his career.
He had shown promise on piano in childhood but became entranced with the trumpet after seeing "Young Man With a Horn" (1950), a Kirk Douglas film about a troubled jazz musician. At the time, he was attending St. Peter's, an Anglican prep school in the suburbs of Johannesburg, where his musical precociousness was matched only by his reputation for unruliness.
"If I can get a trumpet," he promised his chaplain, "I won't bother anybody."
Within a few years, Mr. Masekela became a founding member of the Jazz Epistles, a pathbreaking black jazz group in South Africa. The 1960 Sharpeville massacre, in which scores of anti-apartheid demonstrators were mowed down by police gunfire, squashed Mr. Masekela's dream of touring with the group. With the support of entertainers including Harry Belafonte, Mr. Masekela moved to New York, studied at the Manhattan School of Music and released his first record, "Trumpet Africaine," in 1963.
He married Makeba the following year. "It was difficult, because I was a little bit more popular; men always like to know they're in control," she later told the Guardian, recalling the lead-up to their divorce in 1966. "We just decided, like he likes to say, 'Let's call it a draw.' " The couple continued performing together until her death in 2008.
Mr. Masekela's marriages to singer Chris Calloway, daughter of American bandleader Cab Calloway, and to Jabu Mbatha also ended in divorce. In 1999, he married Ghanaian-born Elinam Cofie.
Survivors include two children from other relationships, Pula Twala and Selema "Sal" Masekela, who works as a musician and journalist; and two sisters, Elaine Masekela and Barbara Masekela, who served as Mandela's chief of staff after he was released from prison and was later South Africa's ambassador to the United States.
Mr. Masekela received a Grammy nomination for best world music album with his 2012 record "Jabulani" and appeared at a White House jazz gala in 2016.
"Heritage restoration is my biggest obsession," he told the San Francisco Classical Voice in 2011. "Our heritage has been condemned over the years by religion and colonization, and by Western media and culture, and unless African music is owned, produced, distributed, packaged and sold by Africans to Africans in Africa, you can't say African music is growing. It's very important to revive heritage and make it visible, so that when our grandchildren grow up, they won't have to say, 'We used to be Africans . . . long ago.' "
Read more Washington Post obituaries