He was born Rolihlahla Mandela on July 18, 1918, into a royal family of the Xhosa-speaking Thembu tribe in the South African village of Mvezo. (In South Africa, Mandela is often called by his clan name, Madiba.) His father, who was Mvezo’s chief, died when he was nine, and the young Mandela was adopted by a high-ranking Thembu regent who groomed the boy for tribal leadership. It was while studying at a local missionary school that he was dubbed Nelson by a teacher, according to the then-common practice of giving African students English names.

At the elite Western-style University of Fort Hare (the only such institution for South African blacks at the time), Mandela was sent home for participating in a boycott of university policies, along with future friend and activist Oliver Tambo and other students. Fleeing a marriage arranged by his guardian, Mandela headed to Johannesburg and worked as a night watchman and a law clerk while completing his bachelor’s degree via correspondence. He then studied law at the University of Witwatersrand, where he became active in the movement against racial discrimination. In 1944, Mandela joined the African National Congress (ANC) in 1944 and helped established its youth league (ANCYL). That same year, he met and married his first wife, Evelyn Ntoko Mase, with whom he had four children before their marriage ended in divorce in 1957. (Mandela married his second wife, Winnie Madikizela-Mandela, in 1958; they would have two daughters.)

In 1948, the Afrikaner-dominated National Party won control of South Africa’s government, and began introducing the formal system of racial classification and segregation that would become known as apartheid. The new regime restricted nonwhite South Africans’ basic rights and barred them from government while maintaining white minority rule. In response, the ANC adopted the ANCYL’s plan to achieve full citizenship for all South Africans through a non-violent campaign of boycotts, strikes, civil disobedience and other methods. In 1952, Mandela traveled around the country as leader of the party’s Campaign for the Defiance of Unjust Laws, promoting a manifesto known as the Freedom Charter. With Tambo, he also started South Africa’s first black law firm, offering legal services to victims of apartheid.

On December 5, 1956, Mandela and 155 other activists were arrested and went on trial for treason for their resistance to the apartheid regime. All were acquitted in 1961, but not before tensions within the ANC led a militant faction leaving the party in 1959 to form the Pan Africanist Congress (PAC). In 1960, police opened fire on a peaceful black protest in Sharpeville, killing 69 people. After the Sharpeville massacre and the bloody riots that followed, Mandela was forced to go underground to avoid governmental persecution; he subsequently decided that more aggressive methods were needed to confront apartheid’s oppression of nonwhite South Africans. In 1961, he co-founded and became the first leader of Umkhonto we Sizwe (“Spear of the Nation”), also known as MK, a new armed wing of the ANC. As he later said of this transition: “It was only when all else had failed, when all channels of peaceful protest had been barred to us, that the decision was made to embark on violent forms of political struggle.”

In January 1962, Mandela traveled abroad illegally, attending a conference of African nationalist leaders in Ethiopia and undergoing guerrilla training in Algeria. Upon his return, he was arrested and sentenced to five years in prison for leaving the country and inciting a 1961 workers’ strike. Things got even worse after a police raid in July 1962 of an ANC hideout in the Johannesburg suburb of Rivonia found evidence implicating Mandela and other activists in the planning of a guerrilla uprising against the government. After an eight-month trial for sabotage, treason and violent conspiracy captured the attention of the world, Mandela and seven other defendants avoided the gallows but were sentenced to life imprisonment.

Mandela spent 18 of the 27 years of his imprisonment at the notorious Robben Island Prison, a former leper colony off the coast of Cape Town. During his time there, he endured hard labor in a lime quarry, inadequate rations and inhumane punishment for even the slightest of offenses. Despite these travails, he was able to earn a bachelor of law degree from University of London and to smuggle out political statements, as well as a draft of his autobiography, “Long Walk to Freedom” (which would be published five years after his release). While in prison, he remained the symbolic leader of the anti-apartheid movement and became its most visible face within South Africa and throughout the world.

In 1982, Mandela was moved to Pollsmoor Prison on the mainland; six years later, he was placed under house arrest at a minimum-security facility. Finally, in 1989, newly elected President F.W. de Clerk broke with the conservatives in the National Party and lifted the government’s ban on ANC, calling for a non-racist South Africa. On February 11, 1990, de Clerk ordered Mandela’s release. Mandela proceeded to lead the ANC in negotiating an end to apartheid with the ruling National Party government, efforts for which he and de Klerk earned the Nobel Peace Prize in December 1993. In April 1994, in the first multiracial parliamentary elections in the nation’s history, Mandela was elected South Africa’s first black president.

With de Klerk as his first deputy, Mandela formed a multiracial “Government of National Unity” to manage the transition to a post-apartheid national government. He established the Truth and Reconciliation Commission to investigate human rights and political violations committed by both supporters and opponents of apartheid between 1960 and 1994, and introduced numerous social and economic programs designed to improve the living standards of South Africa’s black population. In 1996, Mandela presided over the enactment of a new South African constitution, which established a strong central government based on majority rule and prohibited discrimination against minorities, including whites. As president, Mandela resisted calls by some black South Africans by to punish whites for apartheid, instead setting an example of forgiveness and reconciliation, combined with hope for the nation’s future.

His marriage to Winnie Mandela ended in divorce in 1996, and in 1998 Mandela wed the politician and humanitarian Graça Machel, widow of the former president of Mozambique. He served only one term as president before stepping aside in 1999, when he was succeeded by his deputy, Thabo Mbeki, of the ANC. Though officially retired from politics, Mandela remained a leading voice for peace and social justice in Africa and throughout the world. He also embraced the cause of awareness and treatment programs for AIDS, the disease that would claim the life of his son Makgatho in 2005.

Mandela was treated for prostate cancer in 2001 and suffered from other ailments, including chronic lung problems caused by contracting tuberculosis during his 27-year imprisonment. He had scaled back his public appearances in recent years, prompting fears of his weakening health. Mandela was last seen publicly in 2010 during the World Cup soccer championship, which South Africa hosted.

On June 8, 2013, the 94-year-old Mandela entered Mediclinic Heart Hospital in Pretoria in order to be treated for a recurring lung infection. It was the fourth time in less than a year that he had been hospitalized, and comments from South African officials immediately suggested the situation was more serious than with previous hospitalizations. Over the next three weeks, Mandela’s condition deteriorated and he was put on life-support. ANC supporters gathered outside the hospital as Mandela’s relatives, clergy and senior government officials visited the ailing leader.

After a three-month stay, Mandela was released from the hospital in September, but continued to receive around-the-clock medical care at his home in Houghton, a suburb of Johannesburg. In recent days, friends and family began to gather at Mandela’s side, even as a new motion picture celebrating his life, “Long Walk to Freedom,” opened to positive reviews. In announcing Mandela’s death, South African President Jacob Zuma said, “Our nation has lost its greatest son. Our people have lost a father.” Zuma ordered South Africa’s flags to be flown at half-staff and announced plans for a state funeral.