Four months ago Morgan Makaluza, 37, walked out of Brandvlei Correctional Center after serving 13 years for armed robbery. It was his second time in prison. On Wednesday, Makaluza was back at Brandvlei — but this time he served as a motivation to the prisoners, not as an inmate.

Makaluza was at Brandvlei trading notes on coursework and sharing his story with inmates taking part in the launch of South Africa’s Prison to College Pipeline program (P2CP), a collaboration between American professor Dr. Baz Dreisinger, South Africa’s Stellenbosch University, and the South Africa Department of Correctional Services. The program seeks to address recidivism by providing prisoners with access to public university-level education.

Makaluza is the program’s first student in South Africa and credits civil rights icon Nelson Mandela with opening his eyes.

Correctional Services staff listen to speeches during the launch of the Prison to Pipeline program on July 18. Sydelle Willow Smith / for NBC News

While in prison, Makaluza read Mandela’s book “Long Walk to Freedom,” which inspired him to enroll in a correspondence course to finish high school. Mandela, known affectionately as “Madiba,” spent 27 years in prison for trying to overthrow an apartheid government. Deeply familiar with the confines of a jailhouse, the human rights icon famously pursued further education through UNISA while serving his sentence.

On Wednesday, people around the world celebrated Mandela Day, marking what would have been his 100th birthday. Famous figures including former President Barack Obama delivered speeches and called for global action to end poverty.

In the Cape Province of South Africa, Mandela’s home country, the day took on new meaning in an unexpectedly celebratory venue — behind bars. Prison guards and inmates, in civilian clothes for the day, took part in musical performances and motivational speeches.

“I grew up hearing about Mandela but there was one thing that stood out from the whole book,” Makaluza said. “He said, ‘Education is the most powerful weapon which you can use to change the world.’ I decided to do whatever I had to do to get educated.”

Mandela’s ethos motivated the organizers behind the Mandela Day launch of South Africa’s Prison to College Pipeline program. The program aims to highlight Mandela’s “legacy of education behind bars in South Africa,” Dreisinger said. It also facilitate inmates’ reentry into society and helps build better relationships with communities suffering from high crime rates.

Dreisinger, who launched a pilot prison-to-college program in the U.S. in collaboration with the New York State Department of Corrections and The City University of New York, said they had near immediate buy-in from university partners but faced obstacles in broader support for the program in South Africa.

“Given crime is a real crisis here, there isn’t an empathy to the incarcerated population as a whole ... so you’re battling against that climate,” she said.

The celebratory tone of Mandela’s centennial belies a grave reality: South Africa has one of the world’s highest rates of violent crime. The cape region, home to Brandvlei prison, has the highest murder rate in South Africa. Communities here are ravaged by intergenerational cycles of gang violence.

Correctional Services staff stand outside the Brandvlei Correction Centre. Sydelle Willow Smith / for NBC News

Dreisinger insists that giving inmates a second chance at freedom and what is often a first chance to become educated helps break this cycle for entire communities.

Makaluza — who grew up in an informal settlement or “township,” and lost his father at age 6 — said young people facing his circumstances have “zero options.” Without a high school education, he had turned to crime before the age of 13 to support his family, kicking off what felt like a hopeless cycle of jail time.

“I saw the same faces released … and then back in prison with me,” he said.

Dreisinger works with community-based partners to raise awareness of that reality. “It’s not just about sympathy or empathy,” she said, “it’s about giving people opportunity, which … creates public safety.”

Her work in South Africa has striking parallels to her work in the American prison system.

Members of the community listen to speeches during the launch of the Prison to Pipeline program. Sydelle Willow Smith / for NBC News

“All of these students [enrolled in the Prison-to-College Pipeline program] are direct products of years of apartheid and rampant inequality in terms of class and race. Cape Town is still a vastly segregated, unequal place,” Dreisinger said. “The ‘colored’ population is among the most incarcerated population in the world per capita.”

More than 97 percent of the prison population in South Africa at the end of 2016 was listed as black or colored, according to Africa Check, a nonprofit fact-checking organization.

“In my 13 years [in prison], I noticed the prison population is mostly black people, and what we have in common is that we’re uneducated,” he said. “Those with education were out there living their lives and uneducated people from disadvantaged backgrounds were busy filling up prisons.”

Data supports the link between education and staying out of prison: According to one study, incarcerated people who enroll in education programs are 43 percent less likely to go back to prison than those who do not have access to education.

Few know that connection better than the Prison-to-College Pipeline program’s global ambassador for higher education, Devon Simmons.