The son of anti-war radicals sent to prison for murder will be sworn in as San Francisco's district attorney in a few weeks after winning a hotly contested race thanks to his campaigning to reform the criminal justice system.

Chesa Boudin, 39, will take office January 8, 38 years after his parents, who were members of the far-left Weather Underground, dropped him off with a babysitter and took part in an armored car robbery in upstate New York that left two police officers and a security guard dead.

His mother, Kathy Boudin, served 22 years behind bars and his father, David Gilbert, may spend the rest of his life in prison.

They didn't fire shots that day and the victims were killed by the Black Liberation Army.

Chesa Boudin is the son of anti-war radicals sent to prison for murder when he was a toddler after an armored car robbery left cops and a security guard dead

He won San Francisco's tightly contested race for district attorney after campaigning to reform the criminal justice system in November. Pictured as a child with his parents in his campaign video

Kathy Boudin (left in November 24, 1981) served 22 years behind bars and his father, David Gilbert (center in the right image), may spend the rest of his life in prison. Judith Clark, David Gilbert and Katherine Boudin are pictured right October 20, 1981

He said that as one of the dozens of people whose lives were shattered by the deadly robbery in 1981 when he was 14 months old and that his parents have expressed regret at taking part in.

He experienced first-hand the destructive effects of mass incarceration and spoke in his campaign video about having 'to go through a metal detector and steel gates just to give my parents a hug'.

It motivated him to reform. He said he wants to tackle racial bias in the criminal justice system and create a unit to review wrongful convictions, end cash bail, protect immigrants from deportation by not cooperating with ICE and pursue accountability in police misconduct cases.

'My earliest memory is visiting them in prison, but I didn't see the trial or anything like that,' Boudin said in an interview last week. 'My mother negotiated a plea deal, and my father went to trial.

'I think one thing we notice in their case that kind of stands out is how, in some ways, arbitrary the outcomes in the criminal justice system can be. And they did basically the same thing, identical thing.'

The former deputy public defender declared victory after four days of ballot counting determined he was ahead of interim District Attorney Suzy Loftus.

Boudin entered the race as an underdog and captured voters' attention with his extraordinary life story. He won by fewer than 3,000 votes.

Nanuet, New York: Police mark location of fallen Brinks security guard outside a Nanuet bank October 20, 1981. One of the guards was killed during the shooting outside the bank

He said he experienced first-hand the destructive effects of mass incarceration and it motivated him to reform the nation's broken criminal justice system. Boudin is pictured as a child

He remained close to his parents and posted a photo on his Facebook campaign page of a family reunion in New York in November.

'Certainly, one lesson I learned is how ... punitive it can be when your dad, arguably, was given an extra 55 years' minimum sentence than your mother. It also obviously highlights the value of a good lawyer,' NBC reported Boudin said.

He was raised in Chicago by Bill Ayers and Bernardine Dohrn, the leaders of Black Liberation Army partners Weather Underground.

Many prosecutors have praised Boudin (center left, with his parents right in a picture posted on his Facebook in November) but the likes of William Barr and the police associations have accused him of trying to undercut the law

Boudin studied law at Yale University, later won a Rhodes Scholarship and worked as a translator for Venezuela's late President Hugo Chavez before coming to San Francisco.

'I want to restore a sense of compassion,' Boudin continued. 'That's just a true, motivating fact that we do have compassion for victims, compassion for the community ... compassion for the family members of people who are accused of committing crimes and compassion for the people who, themselves, have caused harm. We need to hold them accountable in a way that is serious.

'Because I think that, often, the criminal justice system is dehumanizing to all that it touches from all sides. And people are dealing with real trauma in the case of violent crime and experiences that leave people in fear and make it more likely the people will themselves commit crimes.'

Loftus was appointed the interim district attorney by Mayor London Breed in October after George Gascon announced he was resigning and moving to Los Angeles to explore a run for DA there.

He wants to tackle racial bias in criminal justice, overhaul the bail system, protect immigrants from deportation and get police misconduct accountability

Boudin studied law at Yale University, later won a Rhodes Scholarship and worked as a translator for Venezuela's late President Hugo Chavez before coming to San Francisco. Boudin spoke in his campaign video about having 'to go through a metal detector and steel gates just to give my parents a hug'. He is pictured with his mother, left, and father, right

The American Civil Liberties Union of Northern California accused Breed of undermining the democratic process.

Loftus was endorsed by the city's Democratic establishment, including Gov. Gavin Newsom and Sens. Dianne Feinstein and Kamala Harris.

'San Francisco has always been supportive of a progressive approach to criminal justice ... It's the nature of that town and I congratulate the winner,' Harris said in November while campaigning in Iowa for the Democratic presidential nomination.

Loftus worked for Harris when she was the city's district attorney.

Boudin received high-profile support from Vermont Sen. Bernie Sanders and writer and civil rights activist Shaun King.

'Now is the moment to fundamentally transform our racist and broken criminal justice system by ending mass incarceration, the failed war on drugs and the criminalization of poverty,' Sanders tweeted when he congratulated Boudin on his win.

He said he wants to tackle racial bias in the criminal justice system and create a unit to review wrongful convictions, and end cash bail. Pictured in his campaign video

Boudin wants to protect immigrants from deportation by not cooperating with ICE and pursue accountability in police misconduct cases. Pictured in his campaign video

Philadelphia District Attorney Larry Krasner and Suffolk County, Massachusetts, District Attorney Rachael Rollins have praised Boudin for his transparency and believe he's an asset as someone who has lived the experience of how the criminal justice system affects families.

But in July the San Francisco Deputy Sheriffs' Association posted a campaign video titled 'Terrorist's Son as SF District Attorney? ' as they warned: 'Beware a radical releaser!'

Boudin isn't the only left-leaning prosecutor who has been criticized for his views on decriminalizing sex work and diverting people accused of non-violent crimes to rehabilitaion instead of jail.

As well Krasner and Rollins, Bexar County, Texas DA Joe Gonzales, Queens district attorney candidate Tiffany Caban, and St. Louis County Prosecutor Wesley Bell are well known for their similar views.

In August, Attorney General William Barr said at the Grand Lodge Fraternal Order of Police's 64th National Biennial Conference: 'There is another development that is demoralizing to law enforcement and dangerous to public safety.

'That is the emergence in some of our large cities of District Attorneys that style themselves as "social justice" reformers, who spend their time undercutting the police, letting criminals off the hook, and refusing to enforce the law.'

The San Francisco Deputy Police Officers' Association spent $650,000 trying to beat him.

'For him to just basically say, "Hey, everyone's done their time; they should come out," we don't think that is a safe approach,' president of the officers association, Tony Montoya, told NBC.

'We looked at it as a public safety issue. This was never about Mr. Boudin as a person. This was never about who his parents were. This was about his policies and how they would impact public safety, and public safety is what we do.'

But Boudin claims he simply wants to 'prioritize victims rights' and 'healing'.

'I appreciate that the [Police Officers Association] disagrees and has been critical of me and my way, but I've been very consistent in my commitments to victims,' Boudin added. 'And I, myself, was a victim, indirectly, of my parents' crimes ... and I think there's a lot of room for improvement in what we're doing right now.'