Boxing great Muhammad Ali, who fought white oppression as forcefully as he did his heavyweight opponents, was related to a heroic slave who escaped from bondage and warned Union troops of a Confederate trap, according to a new report.

The fleet-footed fighter was the great-great-great-grandson of Archer Alexander, who became the model for the slave depicted in the Emancipation Memorial statue in Lincoln Park near the US Capitol, the Washington Post reported.

“The beautiful thing about Ali is that he acted all along as if he were royalty, that he had a claim to greatness,” said Jonathan Eig, author of “Ali: A Life,” who investigated the family’s recent discovery and included it in the upcoming paperback edition of the biography.

“Ali spent much of his life attacking racist ideas,” Eig told the newspaper. “If he had known that his great-great-great-grandfather was such a brave and intelligent man, it surely would have strengthened his argument.”

“The Greatest,” who died in 2016 at age 74 after a long battle with Parkinson’s disease, would have likely broken into his Ali shuffle at the news.

“He would have loved knowing he was connected to someone like that,” said his daughter Maryum. “He was ahead of people in understanding that there was a connection that went back through slavery to the kings and queens in Africa.”

Ali’s third cousin, Keith Winstead, 67, an amateur genealogist who retired from a career in computers, made the stunning discovery while conducting research on http://www.23andMe.com, a California-based personal genomics and biotechnology company, the paper reported.

The finding was backed by DNA evidence that Maryum Ali said was collected when Ali and his wife, Lonnie, took part in a study with 23andMe to raise awareness for Parkinson’s.

According to Winstead, Ali’s father, Cassius Clay Sr., was the son of Edith Greathouse, who was Alexander’s great-granddaughter.

Ali, who was born Cassius Clay, changed his name after converting to Islam and joining the Nation of Islam in the early 1960s.

“I didn’t know who Archer Alexander was when I traced the family tree,” Winstead said. “I Googled him, and I just said, ‘Wow!’”

Descendants of slaves can have a tough time tracing their ancestry after their forebears’ identities were wiped out.

“Had Ali been a white man with a courageous and a celebrated ancestor, his family might have enjoyed wealth, fame and political power. Instead, his ancestors struggled to survive,” Eig said.

Alexander, who was born into slavery in Virginia in 1813, was sold and taken to Missouri, where he was owned by a Confederate sympathizer during the Civil War.

In 1863, Alexander learned that Confederate soldiers had destroyed a train bridge that Union troops were planning to cross. He heroically trudged five miles to warn the Union Army, possibly saving hundreds of lives, and also relayed information about hidden weapons.

Facing danger for feeding information to the enemy, Alexander fled to St. Louis and later also helped his wife and children escape.

“Go for your freedom ef [sic] you dies for it,” he once said.

Alexander eventually became a gardener for William Greenleaf Eliot, Washington University’s co-founder and grandfather of the poet T.S. Eliot, who obtained an order of protection for his worker.

The famed literary giant published a biography of Alexander, whose photograph he sent to Italy, where it was used in the construction of the Emancipation Memorial.

The statue — which was dedicated in 1876 in front of Ulysses S. Grant and abolitionist Frederick Douglass — features an emancipated slave with Alexander’s likeness kneeling at the feet of Abraham Lincoln.

“When I’m gone I want my grandchildren and great-grandchildren to give me credit for what I did — and in the same way, I’m happy to know about my ancestors so I can give them credit,” Ali said in a 1980 New York Times article that traced his heritage on his mother’s side.

“Someday I’d like to dig up everything that can be found about all the people I’m descended from,” he added.