Chesa Boudin (second from left), fiancee Valerie Block (left), and his parents, David Gilbert and Katherine Boudin, at the Wende Correctional Facility in Alden, New York.

Weather Underground member Katherine Boudin being taken from Rockland County Courthouse in 1981.

The son of a couple who helped kill two cops and a guard in the infamous Brink’s armored-car robbery was just elected district attorney of San Francisco.

Chesa Boudin learned he won the hotly contested race Saturday — while flying back from visiting his convict dad in an upstate New York prison, the LA Times reported.

Boudin was 14 months old when his parents, David Gilbert and Kathy Boudin, members of the domestic-terror group Weather Underground, dropped him off at a baby-sitter’s Oct. 2, 1981, and helped pull off the heinous heist in Nanuet in Rockland County.

Nyack police Sgt. Edward O’Grady and Officer Waverly “Chipper” Brown, as well as Brink’s guard Peter Paige, were killed in the robbery and its aftermath nearly four decades ago.

The Underground committed the crime along with the Black Liberation Army in the hopes of scoring dough to continue to fund their joint anti-government campaign.

Chesa Boudin ended up being raised by Underground leaders Bill Ayers and Bernardine Dohrn in Chicago while his parents were shipped off to prison.

The 39-year-old Yale University graduate and former Rhodes scholar made no secret of his parents’ notorious past as he campaigned for DA on a platform of criminal-justice reform.

“Growing up, I had to go through a metal detector and steel gates just to give my parents a hug,” Chesa Boudin said in a campaign video.

His mother was paroled in 2003 after serving 22 years behind bars. She later created a firestorm when she went on to teach at Columbia University.

Gilbert is still behind bars.

Their son previously worked as a deputy public defender in San Francisco. He also once served as a translator for late Venezuelan President Hugo Chavez.

The new DA — who has said he wants to address such issues as police misconduct and racial bias and bail reform in his California city — was supported in his campaign by Democratic presidential contender Bernie Sanders.

“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 after Boudin’s win.

The case involving the new DA’s parents is one of the most infamous crimes in local history — and seems to be continually mired in controversy.

In May, convicted heist conspirator Judith Clark was granted parole, infuriating the victims’ families.

With AP