Nelson Mandela, the anti-apartheid icon who became the first president of a democratic South Africa, passed away Thursday at his home in Johannesburg after a prolonged lung infection. He was 95.

South African President Jacob Zuma announced that Mandela, "the founding president of our democratic nation, has departed," adding that he "passed on peacefully."

"Our nation has lost its greatest son. Our people have lost a father," Zuma said.

"Our thoughts are with the millions of people who embraced Mandela as their own and who saw his cause as their cause.… This is the moment of our deepest sorrow.”

Mandela, shown in 2010, married Winnie Madikileza in 1958. (Alexander Joe/Reuters)

Mandela will be accorded a state funeral, Zuma said, and national flags will be lowered to half-mast.

"We saw in him what we seek in ourselves. And in him we saw so much of ourselves," he said. "Nelson Mandela brought us together and it is together that we will bid him farewell."

Mandela's respiratory problems in recent years may have been connected to his imprisonment, when he contracted tuberculosis after working in a prison quarry. He had been in hospital in recent months.

Mandela was a prominent international figure for more than half a century, first as a leading human rights campaigner in South Africa and then as the world's best-known political prisoner.

Following his release, he again became the leader of the anti-apartheid struggle, and in 1994 became the first president of a democratic South Africa.

On July 18, 2009, the first Mandela Day declared by the United Nations, UN Secretary General Ban Ki-moon spoke about how "Nelson Mandela has made a lasting imprint on our lives."

Mandela: the first 25 years

Born the son of a tribal chief on July 18, 1918, in the village of Mvezo in Transkei in the Eastern Cape province, he was given the name Rolihlaha Mandela. Rolihlaha roughly translates from Xhosa as "troublemaker." For the white South African government, he would soon live up to his name.

When Mandela was nine, his father died, and he was sent to live with the chief of the Thembu people.

After Mandela was expelled from university because of his protest activity, the Thembu chief arranged a marriage for Mandela, which he avoided by leaving the Transkei for Johannesburg in 1941. He earned a BA from the University of South Africa in 1943 and then a law degree. Around this time, he joined the African National Congress (ANC).

In his autobiography, Long Walk to Freedom, Mandela wrote, "I have no epiphany, no singular destiny, no moment of truth, but a steady accumulation of a thousand slights, a thousand unremembered moments, produced in me an anger, a rebelliousness, a desire to fight the system that imprisoned my people."

Co-founds ANC Youth League

Formed in 1912, the ANC had been pursuing a non-violent constitutional approach to winning human rights for non-whites.

Mandela had almost no contact with the outside world during his long imprisonment. (Reuters)

In 1944, Mandela co-founded the ANC Youth League. He and other ANCYL leaders pushed for a more militant strategy, one that paid more attention to the needs of the black masses.

That same year, Mandela married Evelyn Mase, a cousin of ANC leader Walter Sisulu. Nelson and Evelyn had four children.

The implementation of apartheid in 1948 gave added urgency to the ANCYL's cause, and by 1949 it had taken over the leadership of the ANC. A new program emphasized self-determination for blacks, which was to be achieved through boycotts, strikes, demonstrations and civil disobedience.

In 1948, Mandela was elected ANCYL secretary and, in 1951, its president.

The new ANC program was implemented in 1952 as the "Defiance Against Unjust Laws Campaign." That led to a violent government response and increased prominence for Mandela, who was elected president of the Transvaal ANC and national deputy president that year.

4½-year treason trial

The South African government continued to implement apartheid laws and intensify repression. In 1956, with the protest movement gaining strength, the government charged Mandela and 155 other leaders with treason and other charges.

Mandela and then wife, Winnie, walk hand-in-hand after Mandela's release from prison, near Cape Town, in 1990. (Greg English/Associated Press)

Mandela led the defence in the 4½-year trial, using the courtroom to defend the ANC and the anti-apartheid cause.

While the trial dragged on, police attacked unarmed protesters in the Johannesburg suburb of Sharpeville in 1960. That sparked a new wave of protests, which led the government to ban the ANC and declare a national emergency. Mandela was again detained.

Finally, in March 1961, the judge acquitted all the defendants in the treason trial, finding there was insufficient evidence and that the ANC policy was non-violent.

During the trial years, Mandela's marriage to Evelyn "collapsed because of differences in politics," according to Mandela, and they divorced. (Evelyn died in 2004.) In 1958, he married Winnie Madikileza and became father to two more daughters.

Mandela goes underground

After the trial, Mandela went underground. In August 1962, Mandela was arrested and charged with helping organize a three-day general strike and leaving the country without a valid travel document.

Mandela, shown beneath the window of his prison cell on Robben Island in 2003, visited the island for an AIDS benefit concert. (Mike Hutchings/Reuters)

Once again, Mandela used the courtroom to present his ideas of equality. He argued he could not receive a fair trial from a judicial system intended to enforce white supremacy. He was convicted on both charges and sentenced to five years in prison.

A police raid on the ANC underground headquarters in 1963 uncovered documents about an ANC guerrilla movement called Umkhonto we Sizwe (Spear of the Nation), which Mandela had helped found in 1961. Umkonto claimed to have carried out more than 70 acts of sabotage against the government. Mandela was charged with treason and sabotage.

During the trial, Mandela declared from the dock, "I have cherished the idea of a democratic and free society, in which all persons will live together in harmony, and with equal opportunities. It is an idea for which I hope to live and to see, but, my lord, if it need be, it is an idea for which I am prepared to die." He received a life sentence.

27 years in prison

Mandela spent 18 years in the Robben Island prison, in which time he was forced to quarry limestone, harvest seaweed and endure brutality from the guards.

Nelson Mandela greets people as he walks with Prime Minister Brian Mulroney on his arrival in Ottawa in 1990 during a three-day visit to Canada. (Wm. DeKay/Canadian Press)

In 1982, along with other imprisoned ANC leaders, he was transferred to Pollsmoor prison outside Capetown. He was hospitalized with tuberculosis in 1988, recovered and returned to prison.

During his years of imprisonment, Mandela had no contact with the outside world, except visits with Winnie.

In 1989, reformer F. W. de Klerk became leader of the governing party and then South African president. Mandela's release seemed imminent.

On Feb. 11, 1990, TV networks around the world broadcast Mandela's walk out of the prison gates to freedom.

Resuming the political fight

At age 71, Mandela plunged back into the anti-apartheid fight, soon taking over the leadership of the now-legal ANC.

Mandela, his wife, Graca Machel, and former U.S. president Jimmy Carter celebrate his 89th birthday in Johannesburg. (Reuters)

That summer, he embarked on a tour of 13 countries, including Canada, to advocate for a continuation of the international economic sanctions campaign.

In 1993, Mandela and de Klerk finally reached agreement on ending apartheid and holding democratic elections. That year, the two men were jointly awarded the Nobel Peace Prize.

The next year, Mandela published his autobiography, Long Walk to Freedom.

Democratic South Africa's first president

In 1994, not only did Mandela vote for the first time, but he was also elected democratic South Africa's first president. The ANC received 63 per cent of the vote.

Many predicted bloodshed and feared the possibility of civil war, fuelled by those seeking retribution for years of apartheid policies. But Mandela oversaw a peaceful transition, embarking on a strategy of reconciliation and urging forgiveness for the perpetrators of past apartheid-era crimes.

He helped establish the Truth and Reconciliation Commission, which sought to record human rights violations from all sides of the apartheid struggle, but also had the power to grant amnesty to those who committed abuses.

For two years, Mandela headed a coalition government, with de Klerk as deputy president, until de Klerk and his party left the government.

In 1996, Nelson divorced Winnie and two years later married Graca Machel, the former first lady of Mozambique.

The new South Africa was not easy to govern. In addition to other challenges, the crime rate soared as Mandela's government worked to improve social conditions and rebuild the economy.

In 1999, at the completion of one term in office, Mandela stepped down as president, "an old man who wants to go into eternity with a smile on his face," he said.

International mediator

However, the "old man" kept up the pace, mediating peace talks in Burundi that year and the next year overseeing negotiations between Libya and the west concerning the 1988 Lockerbie bombing.

In 2001, he visited Canada for the third time, becoming an honorary Canadian citizen.

The following year, he established 46664, a global HIV/AIDS campaign named for Mandela's prisoner number at Robben Island and famous for organizing benefit concerts around the world. (Mandela's son Makgatho died of AIDS in 2005.)

In 2003, he established the Mandela Rhodes Foundation to provide scholarships and mentoring for African youth.

While Mandela said in 2004 that he was officially retiring from public life, he nevertheless went on to initiate The Elders in 2007. This group of former global leaders focuses on peace building, securing the release of political prisoners, humanitarian relief and women's rights.