(CNN) Winnie Madikizela-Mandela, the South African anti-apartheid campaigner and former wife of the late President Nelson Mandela , has died at age 81.

The family said in a statement that she passed away at the Netcare Milpark Hospital in Johannesburg, South Africa after a long illness, for which she had been in and out of hospital since the start of the year.

"Mrs. Madikizela-Mandela was one of the greatest icons of the struggle against apartheid," the statement said. "She fought valiantly against the apartheid state and sacrificed her life for the freedom of the country."

Her death came as a shock. "None of us had predicted this," a family spokesman told CNN.

Madikizela-Mandela was known as the "Mother of the Nation" because of her struggle against white-minority rule in South Africa.

Nelson and Winnie Mandela raise clenched fists to supporters upon Nelson's release from jail in February 1990.

She was married to Nelson Mandela for 38 years, including the 27 years he was imprisoned on an island near Cape Town.

"She kept the memory of her imprisoned husband Nelson Mandela alive during his years on Robben Island and helped give the struggle for justice in South Africa one of its most recognizable faces," the statement said.

The couple were divorced in 1996, two years after Nelson Mandela became South Africa's first black President. They had two daughters together. Nelson Mandela died in 2013.

A longtime stalwart of the ruling African National Congress, or ANC, political party, Madikizela-Mandela was a member of South Africa's parliament at the time of her death.

One of the last official visits she received was from current South African President Cyril Ramaphosa, who went with her to Soweto township last month to encourage people to register to vote in next year's presidential election.

On Monday, Ramaphosa praised Madikizela-Mandela as "an advocate for the dispossessed and the marginalized" and "a voice for the voiceless."

"Even at the darkest moments of our struggle for liberation, Mam' Winnie was an abiding symbol of the desire of our people to be free," Ramaphosa said in a statement. "In the midst of repression, she was a voice of defiance and resistance. In the face of exploitation, she was a champion of justice and equality."

A memorial service for Mandela will be held April 11 and an "official national" funeral will be April 14, Ramaphosa said.

A link to the outside world

Photos: The life of Winnie Madikizela-Mandela Winnie Madikizela-Mandela, an anti-apartheid activist in South Africa and the former wife of late President Nelson Mandela, has died at the age of 81. The outspoken campaigner was known as the "Mother of the Nation" because of her struggle against white minority rule in South Africa. She was a member of South Africa's parliament at the time of her death. Hide Caption 1 of 21 Photos: The life of Winnie Madikizela-Mandela Winnie Madikizela and Nelson Mandela married in South Africa in 1958. Hide Caption 2 of 21 Photos: The life of Winnie Madikizela-Mandela The Mandelas were married for 38 years, including the 27 years that he was imprisoned on an island near Cape Town, South Africa. Hide Caption 3 of 21 Photos: The life of Winnie Madikizela-Mandela People gather in support of Madikizela-Mandela as she leaves a court in Pretoria, South Africa, in 1964. Her husband had just been sentenced to life in prison. Hide Caption 4 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela is pictured in 1977, during her exile in Brandfort, South Africa. Hide Caption 5 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela, center, celebrates alongside her daughter Zindzi and other supporters following her release from Johannesburg Magistrates Court. She had been arrested for defying a court order that banned her from entering Soweto, an area at the center of the anti-apartheid movement in Johannesburg. Hide Caption 6 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela and her two daughters -- Zenani, left, and Zindzi -- arrive at Cape Town's airport to visit her imprisoned husband in 1985. Hide Caption 7 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela is pictured with her grandson in 1986. Hide Caption 8 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela poses in traditional dress in 1986. Hide Caption 9 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela appears at an African National Congress rally in Soweto. Hide Caption 10 of 21 Photos: The life of Winnie Madikizela-Mandela Nelson Mandela is joined by his wife after being released from prison in February 1990. Hide Caption 11 of 21 Photos: The life of Winnie Madikizela-Mandela Mandela leans in to kiss his wife at a rally in March 1990. Hide Caption 12 of 21 Photos: The life of Winnie Madikizela-Mandela A portrait of the Mandelas. The pair divorced in 1996. Hide Caption 13 of 21 Photos: The life of Winnie Madikizela-Mandela The Mandelas meet with Coretta Scott King, widow of civil-rights leader Martin Luther King Jr., in 1990. Hide Caption 14 of 21 Photos: The life of Winnie Madikizela-Mandela The Mandelas are welcomed by former first lady Jackie Kennedy during a visit to Boston in 1990. Hide Caption 15 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela shakes hands with supporters in Rustenburg, South Africa, in 1997. She had just been elected president of the African National Congress Women's League. Hide Caption 16 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela leads a protest march during an international AIDS conference in Durban, South Africa, in 2000. Hide Caption 17 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela, right, joins her ex-husband and his third wife, Graca Machel, during his 90th birthday celebrations in Tshwane, South Africa, in 2008. Hide Caption 18 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela attends her ex-husband's state funeral in 2013. Hide Caption 19 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela greets a crowd of supporters in Soweto for her 80th birthday in 2016. Hide Caption 20 of 21 Photos: The life of Winnie Madikizela-Mandela Madikizela-Mandela joins the hands of South African President Jacob Zuma, left, and Deputy President Cyril Ramaphosa during an African National Congress policy conference in 2017. Hide Caption 21 of 21

Born in 1936 in what is now known as the Eastern Cape province, Nomzamo Winifred Madikizela was the daughter of a history teacher.

As a young social worker, she married Nelson Mandela in 1958 at age 22, and stood by him in the years following his 1964 conviction and life imprisonment sentence for sabotage and conspiracy to overthrow the government.

Madikizela-Mandela led an international campaign calling for his release.

While Nelson Mandela was banned from reading newspapers, his wife was his link to the outside world. Madikizela-Mandela told him of the changes taking place in his homeland and became his often outspoken and controversial public voice.

Nelson Mandela was finally freed in 1990. His defiance of white-minority rule and his long incarceration for fighting against state-sanctioned segregation focused world attention on South Africa's apartheid system, making him the symbol of the struggle to end the practice and bring racial equality to his country.

Outside Africa, Madikizela-Mandela was known largely because of her ex-husband, but in South Africa she was the mouthpiece and face of the bitter struggle against the racist regime.

"She refused to be bowed by the imprisonment of her husband, the perpetual harassment of her family by security forces, detentions, bannings and banishment," said Archbishop Desmond Tutu in a statement. "Her courageous defiance was deeply inspirational to me, and to generations of activists."

A controversial legacy

Although Madikizela-Mandela, who suffered from diabetes, helped usher in a new, more equitable South African political system during her lifetime, she was also entangled in a number of scandals over the years.

In December 1988, her bodyguards, known as the Mandela United Football Club, kidnapped four boys belonging to another anti-apartheid party. One of them, Stompie Moeketsi, was murdered a few days later.

In May 1991 she was sentenced to six years in prison for kidnapping in relation to the incident, but the sentence was later reduced to a fine.

Madikizela-Mandela bounced back and in 1993 was elected president of the ANC's women's league. In 1994, when her then-husband became President, she was elected to parliament and became deputy arts and science minister in the country's first multi-racial government.

Winnie and Nelson Mandela in Soweto, South Africa in February 1990.

Ever the feisty campaigner, Madikizela-Mandela continued to provoke controversy with her attacks on the government and her strident appeals to radical young black followers.

She was expelled from her husband's cabinet a year later.

Madikizela-Mandela was re-elected for a second parliamentary term in 1999 but resigned four years later after she was convicted of fraudulently taking out bank loans and theft -- the loans were used to help poor people.

Her conviction for theft was overturned a year later because she had not recognized any personal gain from her actions.

South Africa's Truth and Reconciliation Commission also accused her of human rights abuses during the apartheid years.

Something of a firebrand, she continued to clash with successive ANC presidents in and out of parliament for the rest of her life.

Winnie Mandela (C) holds the hands of then-President Jacob Zuma (L) and future President Cyril Ramaphosa at the ANC conference in June 2017.

Tributes to Madikizela-Mandela

Madikizela-Mandela was also close to Julius Malema, the leader of the left-wing populist Economic Freedom Fighters opposition party. He made his tribute on Twitter with a simple black frame and crying emojis.

In 2011, Madikizela-Mandela was the subject of a Hollywood biopic starring Oscar-winning actress Jennifer Hudson, along with an opera that premiered in Pretoria, South Africa. She did not like the film.

"I was not consulted," she told CNN in June that year. "I am still alive, and I think that it is a total disrespect to come to South Africa, make a movie about my struggle, and call that movie some translation of a romantic life of Winnie Mandela."

The 2017 British documentary "Winnie" painted a more realistic portrait of her. As the tributes continued to roll in Monday, one of the most tweeted was from the British actor Idris Elba.

Rest in peace Mama Winnie. My heart is heavy right now. You lived a full and important life contributing to the liberation of a nation by force and ACTUAL ACTIVISM. You will never be forgotten. 👊🏾 — Idris Elba (@idriselba) April 2, 2018

"Rest in peace Mama Winnie. My heart is heavy right now," the actor wrote. You lived a full and important life contributing to the liberation of a nation by force and ACTUAL ACTIVISM. You will never be forgotten."

South Africa's parliament said it was "shocked and saddened" by Madikizela-Mandela's death.

"Today we have indeed lost a great leader, a champion of freedom and development, a people's hero, and a Mother, and a defender of the down-trodden," it said in statement Monday. "May her soul rest in peace."