National leaders and ordinary citizens around the world joined Thursday in mourning Nelson Mandela, who spent 27 years as a prisoner in South Africa for opposing apartheid, then emerged to become his country's first black president, winner of the Nobel Peace Prize and an enduring symbol of integrity, principle and resilience.

Mandela died "peacefully" Thursday night at 95 at his home in Johannesburg, surrounded by family, according to South African President Jacob Zuma.

Zuma, dressed in black, announced Mandela's death in a nationally televised address, saying " Our nation has lost its greatest son. Our people have lost a father. Although we knew that this day would come, nothing can diminish our sense of a profound and enduring loss."

Mandela had spent almost three months in a Pretoria hospital after being admitted in June with a recurring lung infection.

Zuma said the man considered by many as the father of his nation would be accorded a full state funeral.

More On This...

In Washington, President Obama called him one of the "most influential, courageous and profoundly good" people to ever have lived.

"He achieved more than could be expected of any man," an emotional Obama said, in remarks from the White House, adding: "He belongs to the ages."

Obama ordered U.S. flags to be lowered immediately to half staff until Monday evening in tribute to Mandela.

Meanwhile, South Africans gathered to celebrate Mandela's life and mourn his death.

Outside the Soweto home where he once lived, some residents sang and danced while others gathered outside his Johannesburg home, where the mood also was lively. A makeshift shrine appeared composed candles, a national flag and bouquets of flowers, along with a picture of him inscribed "Rest in peace, Madiba" -- his clan name..

Mandela, who once said, "the struggle is my life," was a beloved hero of both South Africa and the world itself. His face was instantly recognizable in virtually any country, his story famous enough that he was portrayed in movies at least four times - by Morgan Freeman ("Invictus"), Sidney Poitier ("Mandela and de Klerk"), Danny Glover ("Mandela") and Dennis Haysbert ("Goodbye Bafana").



Stamps were issued with his likeness, songs written about him, statues erected in his honor everywhere from Johannesburg to London and more than 50 universities around the world awarded him degrees. Even a species of spiders was named in his honor.



Mandela, who had been in increasingly frail health in recent years, retired from public life in 2004. He is survived by his third wife, Graca Machel, three daughters (three other children died) and multiple grandchildren and great-grandchildren.

In one of his last public appearances, televised in May 2012, Mandela sat in an armchair with a blanket pulled over his lap at his rural home in Qunu and received a symbolic flame to mark the centenary of the African National Congress.

Ironically, the leader hailed as a symbol of peace at one point was on a U.S. terror watch list because of his affiliation with the ANC, which was designated a terrorist organization by South Africa’s apartheid government. He was finally taken off the list in 2008.

Mandela, although initially committed to non-violence, had, in fact, once been involved with the militant wing of the ANC, which was founded in association with the South African Communist Party and carried out a campaign of violence against government targets.

The man who died an anti-apartheid hero, world statesman and symbol of the strength of the human spirit was born Rolihlahla Mandela in a village near Umtata in the Transkei on July 18, 1918. Rolihlahla literally means "pulling the branch of a tree" but more colloquially, "troublemaker."



His father was primary councilor to the Acting Paramount Chief of Thembuland and after his father's death, the 9-year-old Mandela became the chief's ward. He received the English name Nelson from a primary school teacher at his mission school.



He attended the University College of Fort Hare, a prestigious residential college for blacks in South Africa, where he was expelled over a student boycott, and then ran away from home to Johannesburg to avoid an arranged marriage.



He eventually completed his bachelor's degree via correspondence courses, studied law and joined the African National Congress in 1942.



After 20 years of leading a non-violent campaign against the South African government, his philosophy switched to armed struggle. In 1964 he was sentenced to life imprisonment for plotting to overthrow the government by violence.



For 18 of his 27 years in prison, he was inmate #46664 on Robben Island, a notorious maximum security facility off Cape Town, where he became a worldwide symbol of resistance to racial oppression.



In 1982, he was moved to Pollsmoor Prison, on the nearby mainland, where he spent much of his time in solitary confinement. In 1985, President P. W. Botha offered to release him if he would renounce armed struggle but he refused, saying "only free men can negotiate. Prisoners cannot enter into contracts."



Finally released from this third prison, Victor Verster – an event broadcast internationally - on February 11, 1990 , he was elected president of the ANC in 1991.



In 1993 he and President Frederik Willem De Klerk were jointly awarded the Nobel Peace Prize and in 1994, at the age of 75, he was inaugurated as the first black president of South Africa.



Mandela served as president until 1999, when he retired and became an advocate for a number of human rights organizations and also a spokesman for the fight against AIDS. In 2001 he was treated for prostate cancer.



His philosophy of learning to love instead of hate made him one of the moral leaders of his era.



"No one is born hating another person because of the color of his skin, or his background, or his religion" he wrote in his autobiography.



"People must learn to hate, and if they can learn to hate, they can be taught to love, for loves comes more naturally to the human heart than its opposite."



Mandela was married three times. His first wife was Evelyn Ntoko Mase, from 1944-1957, and they had four children – one son died in a car crash, one son of AIDS and one daughter as an infant.



His second wife was Winnie Madikizela-Mandela (1958-1996) and they had two daughters before divorcing. On his 80th birthday in 1998 he wed Graca Machel, widow of Samora Machel, the former Mozambican president.



But his nation was his beloved offspring as well. "My daughter Zinzi says," he once observed, "that she grew up without a father, who, when he returned, became a father of the nation...for me, there is no place like home."

The Associated Press contributed to this report