Former South African President and anti-apartheid leader Nelson Mandela has died from complications related to a recurring lung infection. He was 95.

Mandela was elected South Africa's first black president by a near two-thirds margin in 1994, after spending 27 years in prison for his role as a leader in South Africa's anti-apartheid movement. He served as president for five years, until retiring in 1999.

For his part in ending apartheid, Mandela was awarded the US Presidential Medal of Freedom and the 1993 Nobel Peace Prize, among many others.

Born in 1918 in a small South African village, Mandela eventually moved to Johannesburg, where in 1942 he joined in the African National Congress, co-founding the group's Youth League in 1944. At the time Mandela was in law school at the University of Witwatersrand, though, in part because of his focus on politics, he failed his third year exams three times and wouldn't practice law until 1953.

His role in the ANC continued to grow throughout the late 1940s and early 1950s, helping transform the group from one reliant on petitions to one that relied upon strikes, boycotts and other forms of civil disobedience. While working with the ANC, he met and recruited a social worker, Winnie Madikizela, whom he went on to marry in 1958.

Mandela supported peaceful forms of protest until 1961, when he co-founded the armed division of the ANC, the Umkhonto we Sizwe, or MK, which focused on guerrilla warfare and sabotage, based on Mandela's newfound beliefs that such measures were necessary to end apartheid. That same year, Mandela organized a workers' strike. In 1962, he was arrested for the strike and sentenced to five years in prison. In early 1964, Mandela and 10 other members of the ANC were sentenced to life in prison after being found guilty on four charges of sabotage and conspiracy to overthrow the government.

Mandela spent the next 18 years of his life in a prison on Robben Island, confined to a damp, 56-square foot concrete cell when he wasn't forced to smash rocks into gravel or work in a lime quarry. For his first few years in prison, he was banned from reading any newspapers, and was allowed only one visitor and one letter every six months.

In 1982, after nearly two decades in Robben, Mandela and other ANC prisoners were transferred to the maximum security Pollsmoor Prison, where, striking up a friendship with the commanding officer, he was allowed a roof garden and and increased rate of correspondence: one letter a week. He underwent prostate surgery and contracted tuberculosis, while staying politically active as South Africa's anti-apartheid movement battled President P.W. Botha. In 1985, offered a chance at early release, on the condition that he renounce armed struggle, Mandela declined.

At the end of the decade, in a new prison in the southwest where he was given a warder's house and private cook, Mandela earned the law degree he had spent part of three decades studying for. Botha suffered a stroke, and was replaced by F. W. De Klerk, who, realizing that the apartheid system was unsustainable, freed all ANC prisoners except Mandela in 1989, and Mandela himself in February 1990.

Upon his release, Mandela traveled throughout Africa, Europe, Asia and the Americas, meeting world leaders and giving addresses. The next year, he returned to South Africa, was elected president of the ANC, and entered into a cease fire with the ruling government.

Despite increasing personal strain involving his deteriorating marriage with Winnie, who was put on trial for kidnapping and and assault, and violence between ANC supporters and other political parties—much of it, he suspected, promoted by the state—Mandela pushed through negotiations for free and democratic elections with De Klerk. After three years of talks, spurred on by the Bisho massacre, the pair agreed to a new, interim constitution and free democratic elections.

Despite the best efforts of violent ethnic separatists, and over the fears of South Africa's white media, the elections were held in April 1994. With 62 percent of the vote, the ANC—banned from the previous election—now controlled parliament and nearly enough votes to change the constitution.

Mandela remained in office for five years, creating the Truth and Reconciliation Commission to push for national reconciliation without alienating the wealthy white elite, increasing spending on aid and development programs in an attempt to bring parity to black and white communities. After his retirement in 1999—Mandela, aged 81, had never planned to run for a second term—he focused on charity and aid work, in particular HIV/AIDS activism.

Mandela had divorced Winnie in 1995, and in 1998 married Mozambican politican Graça Machel. He fathered six children, and is survived by his wife, Graca, and three of his children.

To contact the author of this post, email taylor@gawker.com